summaryrefslogtreecommitdiffhomepage
path: root/tools/nogo/build.go
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-08-26 14:40:30 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-26 14:42:35 -0700
commit983a55aa0649e48467b2e41f9550759535634854 (patch)
treec2f65b4b73089c32f0374062cb974dd4672ad811 /tools/nogo/build.go
parent366f1a8f16077da16df6dfdb411f3b7fb2493a0d (diff)
Support stdlib analyzers with nogo.
This immediately revealed an escape analysis violation (!), where the sync.Map was being used in a context that escapes were not allowed. This is a relatively minor fix and is included. PiperOrigin-RevId: 328611237
Diffstat (limited to 'tools/nogo/build.go')
-rw-r--r--tools/nogo/build.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/nogo/build.go b/tools/nogo/build.go
index 433d13738..37947b5c3 100644
--- a/tools/nogo/build.go
+++ b/tools/nogo/build.go
@@ -31,10 +31,10 @@ var (
)
// findStdPkg needs to find the bundled standard library packages.
-func (i *importer) findStdPkg(path string) (io.ReadCloser, error) {
+func findStdPkg(GOOS, GOARCH, path string) (io.ReadCloser, error) {
if path == "C" {
// Cgo builds cannot be analyzed. Skip.
return nil, ErrSkip
}
- return os.Open(fmt.Sprintf("external/go_sdk/pkg/%s_%s/%s.a", i.GOOS, i.GOARCH, path))
+ return os.Open(fmt.Sprintf("external/go_sdk/pkg/%s_%s/%s.a", GOOS, GOARCH, path))
}