Looking into it it appears that there's active work in
go/build.defaultGOPATH that makes returning an informative error
message impossible.
This made sense when it was done in 428df5e39c0[1], but since then
57568958774[2] has gone in which changes the message from something
that was useful to something that is now almost devoid of information.
was:
```
go install: no install location for directory
/home/user/src/
path.org/to/package outside GOPATH
For more details see: 'go help gopath'
```
now:
```
missing $GOPATH
```
ISTM that the warning provided before 428df5e39c0 is now the better
option in terms of confusion. Perhaps that warning could be an error so
that functional behaviour that exists now would remain, but with an
actual explanation. Stopping with this error would be helpful:
```
warning: GOPATH set to GOROOT (/home/user/go) has no effect
```
[1]
https://go-review.googlesource.com/c/go/+/33105/
[2]
https://go-review.googlesource.com/c/go/+/118095/