From 754aeea8304d896efe28d36077ce1821dbaef91d Mon Sep 17 00:00:00 2001 From: Kevin Franklin Kim Date: Tue, 29 Mar 2022 14:49:20 +0200 Subject: [PATCH] feat: fix std library search --- gotsrpc.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gotsrpc.go b/gotsrpc.go index 737359c..e5a6722 100644 --- a/gotsrpc.go +++ b/gotsrpc.go @@ -144,10 +144,13 @@ func parseDir(goPaths []string, gomod config.Namespace, packageName string) (map } } } - } else if strings.HasSuffix(goPath, "vendor") { - dir = path.Join(goPath, packageName) - } else { - dir = path.Join(goPath, "src", packageName) + } + if dir == "" { + if strings.HasSuffix(goPath, "vendor") { + dir = path.Join(goPath, packageName) + } else { + dir = path.Join(goPath, "src", packageName) + } } pkgs, err := parser.ParseDir(fset, dir, parserExcludeFiles, parser.AllErrors) if err == nil {