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

x/tools/cmd/gotype: can't find import #10969

Closed
noonien opened this issue May 27, 2015 · 4 comments
Closed

x/tools/cmd/gotype: can't find import #10969

noonien opened this issue May 27, 2015 · 4 comments

Comments

@noonien
Copy link

noonien commented May 27, 2015

$ cat $GOPATH/src/x/y/y.go
package y

var Y bool = true
$ cat $GOPATH/src/x/x.go
package main

import (
    "x/y"
)

func main() {
    _ = y.Y
}

Executing gotype $GOPATH/src/x/x.go results in:

/home/george/.go/src/x/x.go:4:2: could not import x/y (can't find import: x/y)
/home/george/.go/src/x/x.go:8:6: undeclared name: y

go run $GOPATH/src/x/x.go produces no error.

@minux
Copy link
Member

minux commented May 27, 2015 via email

@minux minux closed this as completed May 27, 2015
@noonien
Copy link
Author

noonien commented May 27, 2015

I see. I figured as much from the code, however I considered it might be a bug.

Is there any particular reason for why the package has to be compiled in order to check the source code?

@minux
Copy link
Member

minux commented May 27, 2015 via email

@noonien
Copy link
Author

noonien commented May 27, 2015

I see, that makes sense. Thanks!

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

No branches or pull requests

3 participants