We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version
$ go version go version go1.12 linux/amd64
y
go env
$ go env GOARCH="amd64" GOBIN="" GOCACHE="/root/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/root/go" GOPROXY="" GORACE="" GOROOT="/usr/lib/go" GOTMPDIR="" GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/root/mnm-hammer/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build417943255=/tmp/go-build -gno-record-gcc-switches"
file main.go:
package main import "flag" func main() { flag.Parse() } func m2() int { return t2() }
file test.go:
package main import "flag" var sT = "b" func init() { flag.StringVar(&sT, "b", sT, "B") } func t2() int { return 0 }
file main_test.go:
package main import "testing" func TestCoverage(i *testing.T) { if m2() != 0 { i.Fail() } }
build:
$ cd app $ go test -c -covermode=count -coverpkg ./... $ ./app.test -b a:b -test.coverprofile z.cov #fails silently $ ./app.test -test.coverprofile z.cov #works
z.cov in directory
z.cov missing
The text was updated successfully, but these errors were encountered:
Problem is unrelated to -test.coverprofile; never mind!
Sorry, something went wrong.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
y
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
file main.go:
file test.go:
file main_test.go:
build:
What did you expect to see?
z.cov in directory
What did you see instead?
z.cov missing
The text was updated successfully, but these errors were encountered: