govendor install line needs GOPATH setting first, if not already set.
dom-de-v opened this issue · comments
Description
Following a clean install (Ubuntu 16.04 LTS), and apt-get install golang, the install guidance to add govendor fails with this error:
~$ go get -u github.com/kardianos/govendor
package github.com/kardianos/govendor: cannot download, $GOPATH not set. For more details see: go help gopath
~$ sudo go get -u github.com/kardianos/govendor
package github.com/kardianos/govendor: cannot download, $GOPATH not set. For more details see: go help gopath
Reproducible in:
go-audit
version: all - installation guidance issue.
OS version(s): Ubuntu 16.04
Steps to reproduce:
~$ go get -u github.com/kardianos/govendor
Expected result:
Actual result:
package github.com/kardianos/govendor: cannot download, $GOPATH not set. For more details see: go help gopath
Attachments:
n/a
Fixed by first running:
[ -n "${GOPATH}" ] && export GOPATH="$HOME/.gopath" && mkdir -p "$GOPATH/bin" && export PATH="$PATH:$GOPATH/bin"
before :
go get -u github.com/kardianos/govendor