MCPcopy Create free account
hub / github.com/compose-spec/compose-go / Dir

Method Dir

loader/loader.go:163–173  ·  view source on GitHub ↗
(originalPath string)

Source from the content-addressed store, hash-verified

161}
162
163func (l localResourceLoader) Dir(originalPath string) string {
164 path := l.abs(originalPath)
165 if !l.isDir(path) {
166 path = l.abs(filepath.Dir(originalPath))
167 }
168 rel, err := filepath.Rel(l.WorkingDir, path)
169 if err != nil {
170 return path
171 }
172 return rel
173}
174
175func (l localResourceLoader) isDir(path string) bool {
176 fileInfo, err := os.Stat(path)

Callers

nothing calls this directly

Calls 3

absMethod · 0.95
isDirMethod · 0.95
DirMethod · 0.65

Tested by

no test coverage detected