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: go test should not report two compilation failures #26125

Closed
rsc opened this issue Jun 29, 2018 · 7 comments

Comments

Projects
None yet
7 participants
@rsc
Copy link
Contributor

commented Jun 29, 2018

$ cat x_test.go
package p

func f() {
	return 1
}
$ go test x_test.go
# command-line-arguments [command-line-arguments.test]
./x_test.go:4:2: too many arguments to return
	have (number)
	want ()
# command-line-arguments
./x_test.go:4:9: no result values expected
vet: typecheck failures
FAIL	command-line-arguments [build failed]
$ 

The compiler is failing and the vet is failing. It's annoying (or worse) to print the same errors twice, in slightly different forms.
Go 1.10 did the right thing (perhaps because it ignored vet typecheck errors entirely in go test).
Should fix for Go 1.11.
We may need to start ignoring typecheck errors for one more release anyway, in which case we'd get this for free, but we should put in a real fix too, and a test, or else this will happen again in Go 1.12 or whenever we do re-enable typecheck errors from go vet during go test.

@rsc rsc added this to the Go1.11 milestone Jun 29, 2018

@rsc rsc added the release-blocker label Jun 29, 2018

@jimmyfrasche

This comment has been minimized.

Copy link
Member

commented Jun 29, 2018

Duplicate of #26100 ?

@robpike

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2018

It is a duplicate, but this one has an example. I'll close that one.

@robpike

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2018

My suggestion from 26100 is just to suppress errors from vet until compilation has succeeded.

@ysmolsky

This comment has been minimized.

Copy link
Member

commented Jun 30, 2018

Wanted behaviour of vet in the compiler is similar to the way vet is implemented in Playground. There vet check is performed only if the compilation has succeeded. I see this as a good UI.

Playground with vet check is not deployed, thought. @andybons, have you planned the deployment of Playground?

@andybons

This comment has been minimized.

Copy link
Member

commented Jun 30, 2018

@ysmolsky let’s discuss playground deployment off this thread :). (short answer: no, but only because I just haven’t gotten to it).

@ysmolsky

This comment has been minimized.

Copy link
Member

commented Jul 13, 2018

Anyone working on this?

@gopherbot

This comment has been minimized.

Copy link

commented Jul 15, 2018

Change https://golang.org/cl/123938 mentions this issue: cmd/go: skip vet check when the compiler has failed

@gopherbot gopherbot closed this in ad705ba Jul 19, 2018

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