You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [[ "${SYSTEM_GOLANG_VERSION}"<"$GO_MOD_SUPPORT" ]];then
25
-
echo"[$0] ERROR: The version of go on the system (${SYSTEM_GOLANG_VERSION}) is too old and does not support go modules. Please update to at least ${MIN_VERSION}"
23
+
if [[ "$(printf '%s\n'${SYSTEM_GOLANG_VERSION} 1.11 | sort -V | head -n1)"!="1.11" ]];then
24
+
echo"[$0] ERROR: The version of go on the system (${SYSTEM_GOLANG_VERSION}) is too old and does not support go modules. Please update to at least 1.11."
26
25
exit 1
27
26
fi
28
27
29
-
if [ "$1"=="dev" ];then
30
-
if [[ "${SYSTEM_GOLANG_VERSION}"<"${MIN_VERSION}" ]];then
31
-
echo"[$0] WARNING: The version of go on the system (${SYSTEM_GOLANG_VERSION}) is below the recommended version (${MIN_VERSION}) and therefore may not build correctly."
28
+
if [[ "$(printf '%s\n'"$SYSTEM_GOLANG_VERSION""$MIN_VERSION"| sort -V | head -n1)"!="$MIN_VERSION" ]];then
29
+
# We are below the minimum version
30
+
if [ "$1"=="dev" ];then
31
+
echo"[$0] WARNING: The version of go on the system (${SYSTEM_GOLANG_VERSION}) is below the recommended minimum version (${MIN_VERSION}) and therefore may not build correctly."
32
32
echo"[$0] Please update to at least ${MIN_VERSION}"
33
-
fi
34
-
elif [ "$1"=="build" ];then
35
-
if [[ "${SYSTEM_GOLANG_VERSION}"<"${MIN_VERSION}" ]];then
36
-
echo"[$0] ERROR: The version of go on the system (${SYSTEM_GOLANG_VERSION}) is below the necessary version (${MIN_VERSION}) and therefore will not build correctly."
33
+
elif [ "$1"=="build" ];then
34
+
echo"[$0] ERROR: The version of go on the system (${SYSTEM_GOLANG_VERSION}) is below the necessary minimum version (${MIN_VERSION}) and therefore will not build correctly."
37
35
exit 1
38
36
fi
39
37
else
40
38
# Check to make sure that it matches what is specified in `go.mod`.
41
-
GOMOD_VERSION=$(go mod edit -print | awk '/^go[ \t]+[0-9]+\.[0-9]+(\.[0-9]+)?[ \t]*$/{print $2}')
0 commit comments