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/vet: doesn't work when importing a package which is not yet installed #4895

Closed
MichaelTJones opened this issue Feb 24, 2013 · 5 comments

Comments

Projects
None yet
6 participants
@MichaelTJones
Copy link
Contributor

commented Feb 24, 2013

What steps will reproduce the problem?

my main.go imports a local package:

import (
    "flag"
    "fmt"
    "grid"
    "thing/v36/thing"
    "log"
    "os"
...

which works perfectly forever in go run, go fmt, go ... but recently I ran go vet and
get:

mtj$ go vet main.go
vet: main.go:8:2: could not import thing/v36/thing (can't find import: thing/v36/thing)
exit status 1

(No, it's not really called 'thing' but I'm not prepared to disclose the actual name.)


Which compiler are you using (5g, 6g, 8g, gccgo)?

8g

Which operating system are you using?

Mac OS X

Which version are you using?  (run 'go version')

tip, but this is not new in the tip...has been true for a few days at least

go version devel +655b43c97d76 Sun Feb 24 22:47:22 2013 +0800 darwin/amd64


Please provide any additional information below.
@remyoudompheng

This comment has been minimized.

Copy link
Contributor

commented Feb 24, 2013

Comment 1:

A recent modification to vet requires the existence of compiled packages: you can run
"go install thing/v36/thing" to work temporarily around the issue.
@minux

This comment has been minimized.

Copy link
Member

commented Feb 24, 2013

Comment 2:

see also issue #4889, perhaps it makes sense to make cmd/vet do a "go build -work
<arguments>"
before type-checking the package.
@MichaelTJones

This comment has been minimized.

Copy link
Contributor Author

commented Feb 24, 2013

Comment 3:

Indeed, works perfectly now. Thank you!
@rsc

This comment has been minimized.

Copy link
Contributor

commented Feb 25, 2013

Comment 4:

It would definitely be nice for 'go vet' to be able to run in degraded mode. I ran it on
a large uncompiled tree over the weekend and was pretty annoyed by all the import
messages.
Also annoying, and harder to fix: 'go vet' complains about not being able to import "C"
when analyzing cgo programs.
We need to decide what the model is. My suggestion is that 'go vet' uses as much
information as it has, but doesn't complain that it needs more.

Status changed to Accepted.

@robpike

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2013

Comment 5:

This issue was closed by revision 78b3ef2.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015

@rsc rsc removed the go1.1maybe label Apr 14, 2015

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.