Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Same error reported multiple times #1228

Closed
vdemario opened this issue Sep 19, 2017 · 1 comment · Fixed by #1269
Closed

Same error reported multiple times #1228

vdemario opened this issue Sep 19, 2017 · 1 comment · Fixed by #1269

Comments

@vdemario
Copy link

I'm using vscode version 1.16.1 with the Go plugin on version 0.6.65. Recently (first time I noticed it was yesterday when I updated vscode but it might not be related) some build errors are reported multiple times.

@ramya-rao-a suspects it's related to go.buildOnSave being set as workspace. My workspace has a couple of packages that import a base package, if a build error happens on the base package each subpackage reports the same error. If I have an error is on one of the subpackages instead of the base package it gets reported only once.

These are my settings:

{
    "window.zoomLevel": 0,
    "editor.fontSize": 14,
    "editor.fontFamily": "Hack, Menlo, Monaco, 'Courier New', monospace",
    "terminal.integrated.fontSize": 15,
    "git.checkoutType": "local",
    "go.formatTool": "goimports",
    "go.autocompleteUnimportedPackages": true,
    "git.confirmSync": false,
    "go.useCodeSnippetsOnFunctionSuggest": true,
    "workbench.startupEditor": "newUntitledFile",
    "files.autoSave": "off",
    "javascript.format.enable": false,
    "go.lintOnSave": "off",
    "go.vetOnSave": "off",
    "go.formatOnSave": true,
    "go.buildOnSave": "workspace",
    "go.testOnSave": false,
    "go.coverOnSave": false
}

The problems tab looks like this (I just wrote some gibberish on a random file to get a build error):

screen shot 2017-09-19 at 17 14 17

And these are the contents of the output tab:

Finished running tool: /usr/local/go/bin/go test -i -c -o /var/folders/3k/_4m7yyl97y71y4kcb8zhbr3h0000gr/T/go-code-check github.com/mendelics/abcd-api
/Users/vitor/src/github.com/mendelics/abcd-api/consensus_old.go:20: undefined: asdahsgfdhagfsdasdadasd

Finished running tool: /usr/local/go/bin/go test -i -c -o /var/folders/3k/_4m7yyl97y71y4kcb8zhbr3h0000gr/T/go-code-check github.com/mendelics/abcd-api/repository
/Users/vitor/src/github.com/mendelics/abcd-api/consensus_old.go:20: undefined: asdahsgfdhagfsdasdadasd

Finished running tool: /usr/local/go/bin/go test -i -c -o /var/folders/3k/_4m7yyl97y71y4kcb8zhbr3h0000gr/T/go-code-check github.com/mendelics/abcd-api/cmd/abcdworker
/Users/vitor/src/github.com/mendelics/abcd-api/consensus_old.go:20: undefined: asdahsgfdhagfsdasdadasd

Finished running tool: /usr/local/go/bin/go test -i -c -o /var/folders/3k/_4m7yyl97y71y4kcb8zhbr3h0000gr/T/go-code-check github.com/mendelics/abcd-api/handler
/Users/vitor/src/github.com/mendelics/abcd-api/consensus_old.go:20: undefined: asdahsgfdhagfsdasdadasd

Finished running tool: /usr/local/go/bin/go test -i -c -o /var/folders/3k/_4m7yyl97y71y4kcb8zhbr3h0000gr/T/go-code-check github.com/mendelics/abcd-api/cmd/abcdserver
/Users/vitor/src/github.com/mendelics/abcd-api/consensus_old.go:20: undefined: asdahsgfdhagfsdasdadasd

Finished running tool: /usr/local/go/bin/go test -i -c -o /var/folders/3k/_4m7yyl97y71y4kcb8zhbr3h0000gr/T/go-code-check github.com/mendelics/abcd-api/cmd/abcdscheduler
/Users/vitor/src/github.com/mendelics/abcd-api/consensus_old.go:20: undefined: asdahsgfdhagfsdasdadasd

Finished running tool: /usr/local/go/bin/go test -i -c -o /var/folders/3k/_4m7yyl97y71y4kcb8zhbr3h0000gr/T/go-code-check github.com/mendelics/abcd-api/middleware

Let me know if there's anything else I can add to this.

@ramya-rao-a
Copy link
Contributor

The different packages are compiled in parallel, so that output pane will continue to show the results as above.

What we can do is remove the duplicates from the final results here: https://github.com/Microsoft/vscode-go/blob/0.6.65/src/goCheck.ts#L294

This should be an easy fix if anyone wants to give it a try

alexkohler pushed a commit to alexkohler/vscode-go that referenced this issue Oct 5, 2017
alexkohler pushed a commit to alexkohler/vscode-go that referenced this issue Oct 7, 2017
ramya-rao-a pushed a commit that referenced this issue Oct 18, 2017
* Don't show duplicate errors when go.buildOnSave is set to workspace. Fixes #1228

* Lint
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants