[go] tests/GoTest.sh: Fix flags.Parse location to work on new go SDKs. (#6388)

* tests/GoTest.sh: Fix flags.Parse location to work on new go SDKs.

Calling flags.Parse() within init() races with other packages which register
flags in their init(), and in particular with the testing package itself. It is
more reliable to call flags.Parse() from a TestMain implementation.

See https://github.com/golang/go/issues/31859,
https://github.com/golang/go/issues/33869.

* .github: Enable build-go action in build.yaml workflow.
This commit is contained in:
Aaron Son
2021-01-07 11:54:00 -08:00
committed by GitHub
parent 08d2ce844b
commit 41253e574e
4 changed files with 23 additions and 20 deletions

View File

@@ -47,11 +47,11 @@ cp -a ./go_test.go ./go_gen/src/flatbuffers_test/
# flag -test.bench and the wildcard regexp ".":
# go -test -test.bench=. ...
GOPATH=${go_path} go test flatbuffers_test \
--test.coverpkg=github.com/google/flatbuffers/go \
--coverpkg=github.com/google/flatbuffers/go \
--cpp_data=${test_dir}/monsterdata_test.mon \
--out_data=${test_dir}/monsterdata_go_wire.mon \
--test.bench=. \
--test.benchtime=3s \
--bench=. \
--benchtime=3s \
--fuzz=true \
--fuzz_fields=4 \
--fuzz_objects=10000