go
go copied to clipboard
suggested fix for build.sh
hi, sorry for not pull requesting this but here goes
#!/bin/bash
set -e -o pipefail
set -x
export GOPATH="${GOBUILD:-/tmp/build-golang}"
SELF=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || stat -f "${BASH_SOURCE[0]}")
cd "$(dirname "${SELF}")" #just in case ...
GOMODULE=$(go list -m -mod=readonly)
if [ ! -h "$GOPATH/src/$GOMODULE" ]; then
mkdir -p "$GOPATH/src/$(dirname "$GOMODULE")"
ln -s "$PWD" "$GOPATH/src/$GOMODULE"
fi
go get -d -u github.com/golang/dep
cd "$GOPATH/src/$GOMODULE"
exec dep ensure -update
github.com/golang/dep/cmd/dep is deprecated. replaced by github.com/golang/dep fixed the linking and the rest is to make safer and generic getting SELF should be nix/osx safe GOBUILD may be injected to override default