Skip to content
New issue

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

testing: error message is wrong when a typo error exists in TestMain. #22388

Closed
namusyaka opened this issue Oct 23, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@namusyaka
Copy link
Member

commented Oct 23, 2017

What version of Go are you using (go version)?

go version devel +006bc57095

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/numb/workspace/private/go/go"
GORACE=""
GOROOT="/Users/numb/workspace/private/go/go"
GOTOOLDIR="/Users/numb/workspace/private/go/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6b/hxgkjy5d2d1b1633hq3slp14sf3ny_/T/go-build078552962=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

If I have a typo about argument of TestMain, the displayed message seems wrong.

https://play.golang.org/p/Fe6F7R8qKi

What did you expect to see?

wrong signature for TestMain, must be: func TestMain(m *testing.M)

What did you see instead?

wrong signature for TestMain, must be: func TestMain(t *testing.T)

@gopherbot

This comment has been minimized.

Copy link

commented Oct 23, 2017

Change https://golang.org/cl/72591 mentions this issue: testing: fix invalid error message about argument of TestMain

@namusyaka namusyaka changed the title testing: error message is wrong which is displayed when a typo error exists in TestMain. testing: error message is wrong when a typo error exists in TestMain. Oct 23, 2017

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Oct 23, 2017

I believe the error message is correct. The special name TestMain has a special meaning, as described at https://golang.org/pkg/testing.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Oct 23, 2017

Oh, sorry, I completely misread this report. Please ignore my comment.

@namusyaka

This comment has been minimized.

Copy link
Member Author

commented Oct 31, 2017

Could you take a look at the cl?

@namusyaka

This comment has been minimized.

Copy link
Member Author

commented Nov 18, 2017

Any chance for this to be considered for 1.10?

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Nov 19, 2017

It's in now. Thanks.

@gopherbot gopherbot closed this in e4a3043 Nov 19, 2017

@golang golang locked and limited conversation to collaborators Nov 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.