misc: Work around old golang in ubuntu

Hopefully this helps.
This commit is contained in:
James Shubin
2019-09-23 06:04:15 -04:00
parent 13f59230b5
commit 65ee904377

View File

@@ -96,6 +96,16 @@ if [ $travis -eq 0 ]; then
fi fi
fi fi
# attempt to workaround old ubuntu
if [ ! -z "$APT" ] && go version | grep -e 'go1\.[0123456789]\.' -e 'go1\.10\.'; then
echo "install golang from a ppa."
$sudo_command $APT remove -y golang
$sudo_command $APT install -y software-properties-common # for add-apt-repository
$sudo_command add-apt-repository -y ppa:longsleep/golang-backports
$sudo_command $APT update -y
$sudo_command $APT install -y golang-go
fi
# if golang is too old, we don't want to fail with an obscure error later # if golang is too old, we don't want to fail with an obscure error later
if go version | grep -e 'go1\.[0123456789]\.' -e 'go1\.10\.'; then if go version | grep -e 'go1\.[0123456789]\.' -e 'go1\.10\.'; then
echo "mgmt recommends go1.11 or higher." echo "mgmt recommends go1.11 or higher."