h3 -

Spellchaser 2017-10-10 13:59:25 -04:00
parent 1c45aa5265
commit fa9cf731f4

@ -34,16 +34,16 @@ Notice that this is ` src/pkg `; under GOPATH, source files are stored in
Because of this inconsistency, it is generally not recommended that GOPATH be set to or contain GOROOT; its directories will be searched automatically for imports regardless of the GOPATH setting. Because of this inconsistency, it is generally not recommended that GOPATH be set to or contain GOROOT; its directories will be searched automatically for imports regardless of the GOPATH setting.
# Troubleshooting # Troubleshooting
## The ` go build ` command doesn't do anything! #### The ` go build ` command doesn't do anything!
The ` go build ` command will only produce a binary; if you run go build in a package directory, it will build the package normally (and report any compile errors), but it will not install it. For that, you use ` go install `. If you think you're building a binary and none is produced, make sure you are in package ` main ` and that you do not have GOBIN set. The ` go build ` command will only produce a binary; if you run go build in a package directory, it will build the package normally (and report any compile errors), but it will not install it. For that, you use ` go install `. If you think you're building a binary and none is produced, make sure you are in package ` main ` and that you do not have GOBIN set.
## Why does ` go get ` report ` "Fetching https://runtime/cgo?go-get=1" `? #### Why does ` go get ` report ` "Fetching https://runtime/cgo?go-get=1" `?
If you have a source distribution, make sure that your packages are up-to-date. Also double check the environment above. If you have a source distribution, make sure that your packages are up-to-date. Also double check the environment above.
## When cross compiling, I get ` "runtime/extern.go:135: undefined: theGoos" ` #### When cross compiling, I get ` "runtime/extern.go:135: undefined: theGoos" `
Read [[WindowsCrossCompiling]] for some helpful scripts. You can also use the ` --no-clean ` argument when you're building the cross-compile toolchain via ` make.bash `. Read [[WindowsCrossCompiling]] for some helpful scripts. You can also use the ` --no-clean ` argument when you're building the cross-compile toolchain via ` make.bash `.
### Why does ` go get ` work for some packages and report ` permission denied ` in ` $GOROOT ` for some others (with GOPATH set properly)? #### Why does ` go get ` work for some packages and report ` permission denied ` in ` $GOROOT ` for some others (with GOPATH set properly)?
If you at any point installed the package in ` GOROOT ` (either by having no ` GOPATH ` set or by including ` GOROOT ` itself in ` GOPATH `) then there might still be a directory in ` $GOROOT ` (which is always checked first) that is overriding your ` GOPATH `. To verify, run ` go list -f {{.Dir}} importpath ` and if it reports a directory under ` $GOPATH ` try deleting that first. If you at any point installed the package in ` GOROOT ` (either by having no ` GOPATH ` set or by including ` GOROOT ` itself in ` GOPATH `) then there might still be a directory in ` $GOROOT ` (which is always checked first) that is overriding your ` GOPATH `. To verify, run ` go list -f {{.Dir}} importpath ` and if it reports a directory under ` $GOPATH ` try deleting that first.
## Still need help? ## Still need help?