diff --git a/go13.go b/go13.go index ba286d0..437f6d2 100644 --- a/go13.go +++ b/go13.go @@ -2,6 +2,9 @@ package gotool -import "path/filepath" +import ( + "path/filepath" + "runtime" +) -var gorootSrcPkg = filepath.Join(goroot, "src/pkg") +var gorootSrcPkg = filepath.Join(runtime.GOROOT(), "src", "pkg") diff --git a/go14.go b/go14.go index 05faf25..80a383f 100644 --- a/go14.go +++ b/go14.go @@ -2,6 +2,9 @@ package gotool -import "path/filepath" +import ( + "path/filepath" + "runtime" +) -var gorootSrcPkg = filepath.Join(goroot, "src") +var gorootSrcPkg = filepath.Join(runtime.GOROOT(), "src") diff --git a/match.go b/match.go index b33bedf..ee821bb 100644 --- a/match.go +++ b/match.go @@ -37,12 +37,9 @@ import ( "path" "path/filepath" "regexp" - "runtime" "strings" ) -var goroot = filepath.Clean(runtime.GOROOT()) - var buildContext = build.Default // matchPattern(pattern)(name) reports whether