1
0
mirror of https://github.com/golang/go synced 2024-11-11 21:20:21 -07:00

misc/cgo/testshared: call flag.Parse in TestMain

Otherwise, some test flags don't work.

Change-Id: Iacf3930d0eec28e4d690cd382adbb2ecf866a0e2
Reviewed-on: https://go-review.googlesource.com/55615
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Hiroshi Ioka 2017-08-15 20:53:49 +09:00 committed by Ian Lance Taylor
parent c59b495963
commit e6cbf98d69

View File

@ -10,6 +10,7 @@ import (
"debug/elf"
"encoding/binary"
"errors"
"flag"
"fmt"
"go/build"
"io"
@ -161,6 +162,8 @@ func testMain(m *testing.M) (int, error) {
}
func TestMain(m *testing.M) {
flag.Parse()
// Some of the tests install binaries into a custom GOPATH.
// That won't work if GOBIN is set.
os.Unsetenv("GOBIN")