mirror of https://github.com/tidwall/tile38.git
allow for testing go:tip
This commit is contained in:
parent
d178133383
commit
865bbf7d19
7
build.sh
7
build.sh
|
@ -14,11 +14,15 @@ if [ "$PROTECTED_MODE" == "no" ]; then
|
||||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.ProtectedMode=no"
|
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.ProtectedMode=no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check go install
|
||||||
if [ "$(which go)" == "" ]; then
|
if [ "$(which go)" == "" ]; then
|
||||||
echo "error: Go is not installed. Please download and follow installation instructions at https://golang.org/dl to continue."
|
echo "error: Go is not installed. Please download and follow installation instructions at https://golang.org/dl to continue."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check go version
|
||||||
|
GOVERS="$(go version | cut -d " " -f 3)"
|
||||||
|
if [ "$GOVERS" != "devel" ]; then
|
||||||
vercomp () {
|
vercomp () {
|
||||||
if [[ $1 == $2 ]]
|
if [[ $1 == $2 ]]
|
||||||
then
|
then
|
||||||
|
@ -53,10 +57,7 @@ vercomp () {
|
||||||
echo "0"
|
echo "0"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
GOVERS="$(go version | cut -d " " -f 3)"
|
|
||||||
GOVERS="${GOVERS:2}"
|
GOVERS="${GOVERS:2}"
|
||||||
if [ "$GOVERS" != "devel" ]; then
|
|
||||||
EQRES=$(vercomp "$GOVERS" "1.5")
|
EQRES=$(vercomp "$GOVERS" "1.5")
|
||||||
if [ "$EQRES" == "-1" ]; then
|
if [ "$EQRES" == "-1" ]; then
|
||||||
echo "error: Go '1.5' or greater is required and '$GOVERS' is currently installed. Please upgrade Go at https://golang.org/dl to continue."
|
echo "error: Go '1.5' or greater is required and '$GOVERS' is currently installed. Please upgrade Go at https://golang.org/dl to continue."
|
||||||
|
|
Loading…
Reference in New Issue