Skip to content
This repository has been archived by the owner on Apr 10, 2019. It is now read-only.

Use a fork of go tool vet to fix mutli-package directories #375

Merged
merged 2 commits into from
Oct 16, 2017

Conversation

dnephin
Copy link
Collaborator

@dnephin dnephin commented Oct 12, 2017

Fixes #351

Uses a govet fork with this patch dnephin/govet@4a96d43

This seems to fix the issue for me on the gotestyourself project.

@alecthomas
Copy link
Owner

:(

Unfortunate. Are you going to attempt to get this patch merged upstream?

@alecthomas alecthomas merged commit 87b0dd7 into alecthomas:master Oct 16, 2017
@dnephin dnephin deleted the fix-govet branch October 16, 2017 15:29
@dnephin
Copy link
Collaborator Author

dnephin commented Oct 16, 2017

Ya, I'll try. Opened golang/go#22296 and https://go-review.googlesource.com/c/go/+/71170

@dnephin
Copy link
Collaborator Author

dnephin commented Oct 16, 2017

golang/go#22296 (comment)

It sounds like maybe this issue has been fixed as of go v1.9. We should be able to use go vet -shadow.

@dpastoor
Copy link

I think this may have broken gometalinter, at least on travis getting

WARNING: exec: "govet": executable file not found in $PATH

and looking around looks like other projects builds are failing as well.

example travis file: https://github.com/dpastoor/babylon/blob/master/.travis.yml

@dnephin
Copy link
Collaborator Author

dnephin commented Oct 19, 2017

You'll have to install the forked govet, which is automatically installed if you use gometalinter --install.

Alternatively you can configure gometalinter to use the standard go vet

{
  "Linters": {
    "vet": {
      "Command": "go tool vet"
    }
  }
}

@dpastoor
Copy link

kk testing now...

dpastoor added a commit to metrumresearchgroup/bbi that referenced this pull request Oct 19, 2017
@dpastoor
Copy link

thanks for the tip - it works now 👍

@dpastoor
Copy link

for those that run into this PR just added

+ - gometalinter --install
  - gometalinter --disable-all -E vet -E gofmt -E misspell -E ineffassign -E goimports -E deadcode --tests --vendor ./...

in the script section for travis

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vet linter fails when run against a directory with multiple packages
3 participants