Skip to content

Commit

Permalink
misc/cgo/testshared: call flag.Parse in TestMain
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hirochachacha authored and ianlancetaylor committed Aug 15, 2017
1 parent c59b495 commit e6cbf98
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions misc/cgo/testshared/shared_test.go
Expand Up @@ -10,6 +10,7 @@ import (
"debug/elf"
"encoding/binary"
"errors"
"flag"
"fmt"
"go/build"
"io"
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit e6cbf98

Please sign in to comment.