diff --git a/scripts/check_requirement.sh b/scripts/check_requirement.sh index 28cff378ca087..5e159e0c2aab1 100755 --- a/scripts/check_requirement.sh +++ b/scripts/check_requirement.sh @@ -92,8 +92,8 @@ fi # Check go if which go &>/dev/null; then # requires go >= 1.8 - GO_VER_1=`go version | awk 'match($0, /([0-9])+(\.[0-9])+/) { ver = substr($0, RSTART, RLENGTH); split(ver, n, "."); print n[1];}'` - GO_VER_2=`go version | awk 'match($0, /([0-9])+(\.[0-9])+/) { ver = substr($0, RSTART, RLENGTH); split(ver, n, "."); print n[2];}'` + GO_VER_1=`go version | awk 'match($0, /([0-9])+(\.[0-9]+)+/) { ver = substr($0, RSTART, RLENGTH); split(ver, n, "."); print n[1];}'` + GO_VER_2=`go version | awk 'match($0, /([0-9])+(\.[0-9]+)+/) { ver = substr($0, RSTART, RLENGTH); split(ver, n, "."); print n[2];}'` if [[ (($GO_VER_1 -eq 1 && $GO_VER_2 -lt 10)) || (($GO_VER_1 -lt 1)) ]]; then echo "Please upgrade Go to 1.10 or later." exit 1