MCPcopy
hub / github.com/docker/compose / JoinPath

Method JoinPath

pkg/watch/temp_dir_fixture.go:79–92  ·  pkg/watch/temp_dir_fixture.go::TempDirFixture.JoinPath
(path ...string)

Source from the content-addressed store, hash-verified

77}
78
79func (f *TempDirFixture) JoinPath(path ...string) string {
80 p := []string{}
81 isAbs := len(path) > 0 && filepath.IsAbs(path[0])
82 if isAbs {
83 if !strings.HasPrefix(path[0], f.Path()) {
84 f.t.Fatalf("Path outside fixture tempdir are forbidden: %s", path[0])
85 }
86 } else {
87 p = append(p, f.Path())
88 }
89
90 p = append(p, path...)
91 return filepath.Join(p...)
92}
93
94func (f *TempDirFixture) JoinPaths(paths []string) []string {
95 joined := make([]string, len(paths))

Callers 14

JoinPathsMethod · 0.95
WriteFileMethod · 0.95
ReadFileMethod · 0.95
WriteSymlinkMethod · 0.95
MkdirAllMethod · 0.95
RmMethod · 0.95
TestDontWatchEachFileFunction · 0.80
TestWatchBothDirAndFileFunction · 0.80

Calls 1

PathMethod · 0.95