On Thu, Feb 1, 2018 at 8:07 AM, Amedee Van Gasse <amedee.vanga...@gmail.com> wrote: > > On Thursday, February 1, 2018 at 4:59:32 PM UTC+1, Ian Lance Taylor wrote: >> >> On Thu, Feb 1, 2018 at 7:02 AM, Amedee Van Gasse >> <amedee....@gmail.com> wrote: >> > >> > I am taking my first steps with Go and following the instructions on >> > https://golang.org/doc/install to the letter. >> > I am finding documentation issues that are reproducible on a clean >> > system, I >> > can give exact steps to reproduce. >> > >> > To give one example, the documentation says: >> > >> > "(If you'd like to use a different directory, you will need to set the >> > GOPATH environment variable.)" >> > >> > which implies that if you do not set the $GOPATH variable, then the >> > operating system default will be used, for example $HOME/go on Linux. >> > >> > However, if I later follow the instruction "You can run go install to >> > install the binary into your workspace's bin directory", then I get an >> > error: >> > >> > go install: no install location for directory /home/amedee/go/src/hello >> > outside GOPATH >> > >> > This is probably easy to fix by always explicitly setting the $GOPATH >> > variable, despite of what the documentation says about defaults. I still >> > need to confirm it, but it seems the logical solution. >> >> Odd. What does `go env GOPATH` print? > > > It prints a blank, which is expected, because at the point where I was > following the Getting Started documentation > (https://golang.org/doc/install), it had covered setting the $GOROOT and > $PATH environment variables, but not the $GOPATH variable.
Printing a blank suggests that you may have unpacked your Go sources into $HOME/go, so that directory was unavailable for use as GOPATH. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.