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

cmd/go: Errors sometimes reported out of source error #26452

Closed
btracey opened this issue Jul 18, 2018 · 2 comments
Closed

cmd/go: Errors sometimes reported out of source error #26452

btracey opened this issue Jul 18, 2018 · 2 comments

Comments

@btracey
Copy link
Contributor

btracey commented Jul 18, 2018

Please answer these questions before submitting your issue. Thanks!

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

1.11beta1
go version devel +a12c1f26e4 Tue Jun 26 20:00:51 2018 +0000 darwin/amd64

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

go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/brendan/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/brendan/Documents/mygo"
GOPROXY=""
GORACE=""
GOROOT="/Users/brendan/gover/go"
GOTMPDIR=""
GOTOOLDIR="/Users/brendan/gover/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
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"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/l6/mhj4qjrj4437b_lgfz9pm1rw0000gn/T/go-build491566060=/tmp/go-build -gno-record-gcc-switches -fno-common"
VGOMODROOT=""

What did you do?

Doing some code refactoring, and noticed that the vet half of the compile errors were sometimes printing out of source order

brendan:~/Documents/mygo/src/gonum.org/v1/gonum/optimize$ go test -v
# gonum.org/v1/gonum/optimize [gonum.org/v1/gonum/optimize.test]
./unconstrained_test.go:1185:18: undefined: Global
./unconstrained_test.go:1249:20: undefined: Global
./unconstrained_test.go:1302:10: undefined: Global
./unconstrained_test.go:1319:17: undefined: Global
# gonum.org/v1/gonum/optimize
./unconstrained_test.go:1319:17: undeclared name: Global
./unconstrained_test.go:1302:10: undeclared name: Global
./unconstrained_test.go:1185:18: undeclared name: Global
./unconstrained_test.go:1249:20: undeclared name: Global
vet: typecheck failures

I've made a .zip file of the code at the state right now that can be shared. It comes from a package with a lot of code, so it's hard to produce a minimal reproducer.

What did you expect to see?

I would have expected the errors to come in the same order as the compile errors.

@btracey btracey changed the title cmd/vet: Errors sometimes reported out of source error cmd/go: Errors sometimes reported out of source error Jul 18, 2018
@josharian
Copy link
Contributor

Dup of #26236?

@FiloSottile
Copy link
Contributor

Closing as duplicate of #26236, please let me know if you think that's not correct.

@golang golang locked and limited conversation to collaborators Jul 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants