Hi,

I ran a quick experiment in my source tree, and saw a difference in
the behavior of "go test -c" between go 1.12 and go 1.13.

EXPERIMENT 1:  using docker image golang:1.12-alpine with go1.12.16 
linux/amd64
----------------------------------------------------------------------------------------------------------------------
go test -o my_test -c my_test.go

my_test --help

I see this flag:
  -test.timeout d
        panic test binary after duration d (default 0, timeout disabled)

EXPERIMENT 2: using docker image golang:1.13-alpine with go1.13.7 
linux/amd64
----------------------------------------------------------------------------------------------------------------------
go tet -o my_test -c my_test.go

my_test --help

The -test.timeout flag is not there.  In fact all the -test.timeout flags 
are gone.

Is there a way that I can get back these -test.XXX flags with go1.13 and 
higher?

I see here that this might be related: https://golang.org/doc/go1.13#testing

          Testing flags are now registered in the new Init 
<https://golang.org/pkg/testing/#Init> function, 
          which is invoked by the generated main function for the test.
          As a result, testing flags are now only registered when running
          a test binary, and packages that call flag.Parse during package
          initialization may cause tests to fail. 

But I'm not sure how to move forward to get back the behavior from go 1.12.

Thanks for any help.

--
Craig

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/fba04e17-95fc-4ba6-92fd-998195cee2b9%40googlegroups.com.

Reply via email to