Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Unable to use "go vet" when using "dep ensure" #348

Closed
delanne opened this issue Mar 23, 2017 · 1 comment
Closed

Unable to use "go vet" when using "dep ensure" #348

delanne opened this issue Mar 23, 2017 · 1 comment

Comments

@delanne
Copy link

delanne commented Mar 23, 2017

When I do "dep ensure -v" in order to fech dependencies, the "go vet" command fails with:

vet: /go/src/foo/bar/main.go:4:2: could not import github.com/Sirupsen/logrus (can't find import: foo/vendor/github.com/Sirupsen/logrus)

In order to be able to use the "go vet" command, I need to do a "go get" after "dep ensure"

In attachment: dep_issue.zip in order to reproduce the issue.

$ unzip dep_issue.zip && cd dep_issue && docker run --rm -v "$PWD":/go -w /go golang:1.8.0 ./build.sh
Archive:  dep_issue.zip
   creating: dep_issue/
  inflating: dep_issue/build.sh      
   creating: dep_issue/src/
   creating: dep_issue/src/foo/
  inflating: dep_issue/src/foo/lock.json  
 extracting: dep_issue/src/foo/manifest.json  
   creating: dep_issue/src/foo/bar/
  inflating: dep_issue/src/foo/bar/main.go  

-- installing dep --

github.com/golang/dep (download)
github.com/golang/dep/vendor/github.com/Masterminds/semver
github.com/golang/dep/vendor/github.com/pkg/errors
github.com/golang/dep/hack/licenseok
github.com/golang/dep/vendor/github.com/Masterminds/vcs
github.com/golang/dep/vendor/github.com/armon/go-radix
github.com/golang/dep/test
github.com/golang/dep/vendor/github.com/sdboyer/gps
github.com/golang/dep
github.com/golang/dep/cmd/dep

-- dependencies --

Root project is "foo"
 1 transitively valid internal packages
 1 external packages imported from 1 projects
(0)   ✓ select (root)
(1)	? attempt github.com/Sirupsen/logrus with 1 pkgs; at least 1 versions to try
(1)	    try github.com/Sirupsen/[email protected]
(1)	✓ select github.com/Sirupsen/[email protected] w/1 pkgs
(2)	? attempt golang.org/x/sys with 1 pkgs; at least 1 versions to try
(2)	    try golang.org/x/sys@master
(2)	✓ select golang.org/x/sys@master w/1 pkgs
  ✓ found solution with 2 packages from 2 projects
         b-list-pkgs: 4.345450828s
     b-source-exists:  1.25669774s
  b-deduce-proj-root: 233.292086ms
              b-gmal:  17.279564ms
         select-atom:    381.247µs
             satisfy:    276.092µs
            new-atom:    124.264µs
         select-root:     57.709µs
               other:      7.003µs

  TOTAL: 5.853566533s


Solver wall times by segment:

-- vet --

vet: /go/src/foo/bar/main.go:4:2: could not import github.com/Sirupsen/logrus (can't find import: foo/vendor/github.com/Sirupsen/logrus)
Checking file /go/src/foo/bar/main.go

dep_issue.zip

@delanne
Copy link
Author

delanne commented Mar 23, 2017

Seems to be a vet bug instead of a dep issue (golang/go#17571)

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

No branches or pull requests

2 participants