From: Hiroshi Ioka Date: Tue, 15 Aug 2017 11:53:49 +0000 (+0900) Subject: misc/cgo/testshared: call flag.Parse in TestMain X-Git-Tag: go1.10beta1~1555 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e6cbf98d696c0b8e800951698de1d30d15cae03f;p=gostls13.git 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 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- diff --git a/misc/cgo/testshared/shared_test.go b/misc/cgo/testshared/shared_test.go index 9e682a2fb5..97cdc80af8 100644 --- a/misc/cgo/testshared/shared_test.go +++ b/misc/cgo/testshared/shared_test.go @@ -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")