diff options
Diffstat (limited to 'gocomplete/pkgs.go')
| -rw-r--r-- | gocomplete/pkgs.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/gocomplete/pkgs.go b/gocomplete/pkgs.go index 356a0fa..e3a85d9 100644 --- a/gocomplete/pkgs.go +++ b/gocomplete/pkgs.go @@ -4,8 +4,6 @@ import ( "bytes" "encoding/json" "os/exec" - "path/filepath" - "regexp" "strings" "github.com/posener/complete" @@ -13,9 +11,6 @@ import ( const goListFormat = `{"Name": "{{.Name}}", "Path": "{{.Dir}}", "FilesString": "{{.GoFiles}}"}` -// regexp matches a main function -var reMainFunc = regexp.MustCompile("^main$") - func predictPackages(a complete.Args) (prediction []string) { dir := a.Directory() pkgs := listPackages(dir) @@ -27,27 +22,6 @@ func predictPackages(a complete.Args) (prediction []string) { return complete.PredictFilesSet(files).Predict(a) } -func predictRunnableFiles(a complete.Args) (prediction []string) { - dir := a.Directory() - pkgs := listPackages(dir) - - files := []string{} - for _, p := range pkgs { - // filter non main pacakges - if p.Name != "main" { - continue - } - for _, f := range p.Files { - path := filepath.Join(p.Path, f) - if len(functionsInFile(path, reMainFunc)) > 0 { - files = append(files, path) - } - } - } - complete.Log("FILES: %s", files) - return complete.PredictFilesSet(files).Predict(a) -} - type pack struct { Name string Path string |
