Skip to content

Commit 49a1733

Browse files
Merge pull request #18807 from soltysh/fix_golang_check
Automatic merge from submit-queue. Fix golang check so that it performs arithemtic comparison /assign @stevekuznetsov
2 parents c1befdd + 117392b commit 49a1733

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hack/lib/util/golang.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function os::golang::verify_go_version() {
88

99
local go_version
1010
go_version=($(go version))
11-
if [[ "${go_version[2]}" < "${OS_REQUIRED_GO_VERSION}" ]]; then
11+
if ! echo "${go_version[2]#go}" | awk -F. -v min=${OS_REQUIRED_GO_VERSION#go} '{ exit $2 < min }'; then
1212
os::log::info "Detected go version: ${go_version[*]}."
1313
if [[ -z "${PERMISSIVE_GO:-}" ]]; then
1414
os::log::fatal "Please install Go version ${OS_REQUIRED_GO_VERSION} or use PERMISSIVE_GO=y to bypass this check."

0 commit comments

Comments
 (0)