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 appear multiple times #26100

Closed
robpike opened this issue Jun 28, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@robpike
Copy link
Contributor

commented Jun 28, 2018

Related to but distinct from #24278

If there is a syntax or type error in a test, running go test causes each error to be reported multiple times, once by vet and once by either go test's internals or the compiler, depending on the particular error.

The go command should sequester errors from vet until the other process completes, and drop them on the floor if the main process generates an error. Or to put it another way, errors from vet should appear only if compilation of the test is otherwise successful.

@bcmills

This comment has been minimized.

Copy link
Member

commented Jun 28, 2018

Same root cause as #26102?

@bcmills

This comment has been minimized.

Copy link
Member

commented Jun 28, 2018

Looks like #26102 is related but separate.

@bcmills

This comment has been minimized.

Copy link
Member

commented Jun 28, 2018

(CC: @mvdan @rsc )

@bcmills

This comment has been minimized.

Copy link
Member

commented Jun 28, 2018

Is this behavior present in 1.10, or is this a regression in 1.11?

@bcmills bcmills added NeedsFix and removed NeedsInvestigation labels Jun 28, 2018

@mvdan

This comment has been minimized.

Copy link
Member

commented Jun 28, 2018

#26102 is unrelated, I'm afraid. That one is simply a vet bug.

The reason this issue is different from #24278 is explained by a comment of mine there:

Actually, I was wrong - my particular case had nothing to do with vet. My problem was coming from go test using go/parser directly in loadTestFuncs. Skipping this error is a bit tricky, since this happens much earlier than the build action. I'm no longer sure that a change in test is the right fix.

That also explains why, in this case, errors appear multiple times.

Is this behavior present in 1.10, or is this a regression in 1.11?

If the error is a type-check error, this is probably a regression in 1.11. @robpike do you have a working example we can test with?

@bcmills bcmills added this to the Go1.11 milestone Jun 28, 2018

@dsymonds

This comment has been minimized.

Copy link
Member

commented Jun 28, 2018

@bcmills: I observed this the other day in my own work. It's a regression since Go 1.10.

@robpike

This comment has been minimized.

Copy link
Contributor Author

commented Jun 29, 2018

Duplicate of #26125

@robpike robpike marked this as a duplicate of #26125 Jun 29, 2018

@robpike robpike closed this Jun 29, 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.