Skip to content

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

@namusyaka

Description

@namusyaka

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions