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
by raul.san@sent.com:
build.Import is loading data about GOROOT instead of use GOPATH like I've set. // * * * package main import ( "fmt" "go/build" "log" ) func main() { fmt.Println("GOROOT:", build.Default.GOROOT) fmt.Println("GOPATH:", build.Default.GOPATH) println() pkg, err := build.Import("", build.Default.GOPATH, build.FindOnly) if err != nil { log.Fatalf("GOROOT is not set: %s", err) } fmt.Println(pkg) } // * * * GOROOT: /opt/go GOPATH: /opt/go-3pkg:/home/under/go &{/opt/go/src/pkg /opt/go /opt/go/src/pkg /opt/go/pkg /opt/go/bin true /opt/go/pkg/linux_amd64/.a [] [] [] [] [] [] [] [] [] [] map[] [] [] map[] [] [] map[]}
The text was updated successfully, but these errors were encountered:
Comment 1:
Import paths found in GOROOT take precedence over import paths found in GOPATH. You have asked for the empty import path, which should be rejected. But since it is not rejected, and GOROOT+"/src/pkg/"+"" is a directory, Import uses that.
Labels changed: added priority-soon, removed priority-triage.
Status changed to Accepted.
Sorry, something went wrong.
Comment 2:
Labels changed: added go1.1.
Comment 3:
This issue was closed by revision ec9967f.
Status changed to Fixed.
No branches or pull requests
by raul.san@sent.com:
The text was updated successfully, but these errors were encountered: