MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / Files

Function Files

tools/owl/scan/scanner.go:63–80  ·  view source on GitHub ↗

Files returns the collection of all file paths under the specified path

(folder string)

Source from the content-addressed store, hash-verified

61
62// Files returns the collection of all file paths under the specified path
63func Files(folder string) ([]string, error) {
64 var result []string
65
66 filepath.Walk(folder, func(filePath string, fi os.FileInfo, err error) error {
67 if err != nil {
68 return err
69 }
70 if !fi.IsDir() {
71 // If you want to ignore this directory, return filepath.SkipDir, ie:
72 // return filepath.SkipDir
73 result = append(result, filePath)
74 }
75
76 return nil
77 })
78
79 return result, nil
80}
81
82// Md5 get the md5 value of the file based on the path
83func Md5(filepath string) (string, error) {

Callers 2

SearchMethod · 0.85
ListMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected