You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Windows, the text from the log.Println statement gets output to stdout
In Mac, the text from the log.Println statement does NOT get output to stdout
go test on the other hand (without passing the package) does output the text from the log.Println statement even without the -v flag
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
go test -v does not output text from log.Println when package is passed
cmd/go: test -v does not output text from log.Println when package is passed
Oct 2, 2017
Please show us the exact commands that you run. When I put the file you describe in $GOPATH/src/issue22113/x_test.go and run go test -v issue22113, I see this:
=== RUN TestMe
2017/10/02 12:56:48 logging
--- PASS: TestMe (0.00s)
PASS
ok issue22113 0.038s
That is, the log.Println output does appear. It's perhaps worth noting that it does not appear on standard output; it appears on standard error. That is because the log package's standard logger outputs to standard error by default.
I had another copy of the same project in the default GOPATH for go 1.9 on my Mac which did not have the log statements. That was the package being run.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go 1.9
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?darwin/amd64 and windows/amd64
What did you do?
Run
go test -v
with package as argument for the below testWhat did you expect to see?
The text from the
log.Println
statementWhat did you see instead?
In Windows, the text from the
log.Println
statement gets output to stdoutIn Mac, the text from the
log.Println
statement does NOT get output to stdoutgo test
on the other hand (without passing the package) does output the text from thelog.Println
statement even without the-v
flagThe text was updated successfully, but these errors were encountered: