Use `go env GOPATH` instead of env variable

Fixes #1733
This commit is contained in:
Richard Weber 2018-03-17 23:50:11 +02:00
Родитель 7d5cd199ce
Коммит 3bf0cd1497
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -65,12 +65,13 @@ downloadFile() {
}
findGoBinDirectory() {
if [ -z "$GOPATH" ]; then
echo "Installation requires \$GOPATH to be set for your Golang environment."
EFFECTIVE_GOPATH=$(go env GOPATH)
if [ -z "$EFFECTIVE_GOPATH" ]; then
echo "Installation could not determine your \$GOPATH."
exit 1
fi
if [ -z "$GOBIN" ]; then
GOBIN="$GOPATH/bin"
GOBIN="$EFFECTIVE_GOPATH/bin"
fi
if [ ! -d "$GOBIN" ]; then
echo "Installation requires your GOBIN directory $GOBIN to exist. Please create it."