MCPcopy Create free account
hub / github.com/posener/complete / functionsInFile

Function functionsInFile

gocomplete/parse.go:11–27  ·  view source on GitHub ↗
(path string, regexp *regexp.Regexp)

Source from the content-addressed store, hash-verified

9)
10
11func functionsInFile(path string, regexp *regexp.Regexp) (tests []string) {
12 fset := token.NewFileSet()
13 f, err := parser.ParseFile(fset, path, nil, 0)
14 if err != nil {
15 log.Printf("Failed parsing %s: %s", path, err)
16 return nil
17 }
18 for _, d := range f.Decls {
19 if f, ok := d.(*ast.FuncDecl); ok {
20 name := f.Name.String()
21 if regexp == nil || regexp.MatchString(name) {
22 tests = append(tests, name)
23 }
24 }
25 }
26 return
27}

Callers 1

funcNamesFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…