MCPcopy Create free account
hub / github.com/fogleman/nes / getPaths

Function getPaths

main.go:22–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22func getPaths() []string {
23 var arg string
24 args := os.Args[1:]
25 if len(args) == 1 {
26 arg = args[0]
27 } else {
28 arg, _ = os.Getwd()
29 }
30 info, err := os.Stat(arg)
31 if err != nil {
32 return nil
33 }
34 if info.IsDir() {
35 infos, err := ioutil.ReadDir(arg)
36 if err != nil {
37 return nil
38 }
39 var result []string
40 for _, info := range infos {
41 name := info.Name()
42 if !strings.HasSuffix(name, ".nes") {
43 continue
44 }
45 result = append(result, path.Join(arg, name))
46 }
47 return result
48 } else {
49 return []string{arg}
50 }
51}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…