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
Closed

cmd/go: errors appear multiple times #26100

robpike opened this issue Jun 28, 2018 · 7 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@robpike
Copy link
Contributor

robpike 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
Copy link
Contributor

bcmills commented Jun 28, 2018

Same root cause as #26102?

@bcmills
Copy link
Contributor

bcmills commented Jun 28, 2018

Looks like #26102 is related but separate.

@bcmills
Copy link
Contributor

bcmills commented Jun 28, 2018

(CC: @mvdan @rsc )

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 28, 2018
@bcmills
Copy link
Contributor

bcmills commented Jun 28, 2018

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

@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 28, 2018
@mvdan
Copy link
Member

mvdan 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
Copy link
Contributor

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

@robpike
Copy link
Contributor Author

robpike commented Jun 29, 2018

Duplicate of #26125

@robpike robpike marked this as a duplicate of #26125 Jun 29, 2018
@robpike robpike closed this as completed Jun 29, 2018
@golang golang locked and limited conversation to collaborators Jun 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants