bazelbuild / rules_go

Go rules for Bazel
Apache License 2.0
1.36k stars 635 forks source link

Support Go version schema change since 1.21 #3891

Closed baizhenyu closed 3 months ago

baizhenyu commented 3 months ago

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

Since Golang 1.21, the initial minor version has a .0 suffix e.g 1.21.0. As a result, it breaks the default behaviour of go_download_sdk.

By default (see the doc), if no version is specified, then the latest version is used. After it searches for the highest Go version, it uses _version_string function to make small transformation. The deleted lines removes that .0 suffix and will cause following error:

Error in fail: did not find version 1.22 in https://go.dev/dl/?mode=json

Which issues(s) does this PR fix?

Fixes #3850

Other notes for review