We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 927ceb7 commit b7dac53Copy full SHA for b7dac53
script/ensure-go-installed.sh
@@ -4,14 +4,12 @@ if [ -z "$ROOTDIR" ]; then
4
echo 1>&2 'ensure-go-installed.sh invoked without ROOTDIR set!'
5
fi
6
7
-# Is go installed, and at least 1.7?
+# Is go installed, and at least 1.9?
8
go_ok() {
9
- case "$(go version 2>/dev/null | sed -n 's/.*go\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p' | head -n 1)" in
10
- ""|0.*|1.[012345678])
11
- false ;;
12
- *)
13
- true ;;
14
- esac
+ set -- $(go version 2>/dev/null |
+ sed -n 's/.*go\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1 \2/p' |
+ head -n 1)
+ [ $# -eq 2 ] && [ "$1" -eq 1 ] && [ "$2" -ge 9 ]
15
}
16
17
# If a local go is installed, use it.
0 commit comments