MCPcopy Index your code
hub / github.com/go-python/gopy / Dirs

Function Dirs

dirs.go:12–25  ·  view source on GitHub ↗

Dirs returns a slice of all the directories within a given directory

(path string)

Source from the content-addressed store, hash-verified

10
11// Dirs returns a slice of all the directories within a given directory
12func Dirs(path string) []string {
13 files, err := os.ReadDir(path)
14 if err != nil {
15 return nil
16 }
17
18 var fnms []string
19 for _, fi := range files {
20 if fi.IsDir() {
21 fnms = append(fnms, fi.Name())
22 }
23 }
24 return fnms
25}

Callers 1

buildPkgRecurseFunction · 0.85

Calls 1

NameMethod · 0.45

Tested by

no test coverage detected