What version of Go are you using (go version)?
$ go version
go version go1.12.5 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/cosmin/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/cosmin/go:/home/cosmin/dev/git"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go-1.12.5"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.12.5/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/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-build217071151=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Run go vet something_test.go
What did you expect to see?
Successful execution
What did you see instead?
isomething_test.go: undefined: MyModel
even if MyModel is defined and go test executes successfully.
It may be a regression of #26797
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
Run
go vet something_test.goWhat did you expect to see?
Successful execution
What did you see instead?
isomething_test.go: undefined: MyModeleven if
MyModelis defined andgo testexecutes successfully.It may be a regression of #26797