diff --git a/misc/cgo/testshared/shared_test.go b/misc/cgo/testshared/shared_test.go index 232ca3394a..6ef448c4f2 100644 --- a/misc/cgo/testshared/shared_test.go +++ b/misc/cgo/testshared/shared_test.go @@ -143,6 +143,10 @@ func testMain(m *testing.M) (int, error) { } func TestMain(m *testing.M) { + // Some of the tests install binaries into a custom GOPATH. + // That won't work if GOBIN is set. + os.Unsetenv("GOBIN") + flag.Parse() exitCode, err := testMain(m) if err != nil {