2017-07-26 22:00:20 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
go tool dist list >/dev/null || {
|
|
|
|
echo 1>&2 "go tool dist list not supported - can't check compile"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2019-02-09 12:50:35 +00:00
|
|
|
failures=0
|
2017-07-26 22:00:20 +00:00
|
|
|
while read -r line; do
|
|
|
|
parts=(${line//\// })
|
|
|
|
export GOOS=${parts[0]}
|
|
|
|
export GOARCH=${parts[1]}
|
2019-02-09 12:50:35 +00:00
|
|
|
if go tool compile -V >/dev/null 2>&1 ; then
|
|
|
|
echo Try GOOS=${GOOS} GOARCH=${GOARCH}
|
|
|
|
if ! go install; then
|
|
|
|
echo "*** Failed compiling GOOS=${GOOS} GOARCH=${GOARCH}"
|
|
|
|
failures=$((failures+1))
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo Skipping GOOS=${GOOS} GOARCH=${GOARCH} as not supported
|
|
|
|
fi
|
2017-07-26 22:00:20 +00:00
|
|
|
done < <(go tool dist list)
|
2019-02-09 12:50:35 +00:00
|
|
|
|
|
|
|
if [ $failures -ne 0 ]; then
|
|
|
|
echo "*** $failures compile failures"
|
|
|
|
exit 1
|
|
|
|
fi
|