Skip to content

Commit

Permalink
Update golang.org/x/tools to v0.18.0 to gazelle's hardcoded version
Browse files Browse the repository at this point in the history
Gazelle hardcodes a minimum golang.org/x/tools version in their MODULE.bazel https://github.com/bazelbuild/bazel-gazelle/blob/master/MODULE.bazel\#L37
We should ensure we depend on at least that version

Test: Bazel stops complaining about mismatched versions
Bug: b/303263153
Change-Id: Ie0a12598107254783ed1dcd27a94516e7b182559
GitOrigin-RevId: bcd448cd2555dd04008349bfa65e37fdaeba43a2
  • Loading branch information
bentekkie authored and copybara-github committed Jul 9, 2024
1 parent 8ab14d3 commit 08b212a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 13 deletions.
7 changes: 0 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,6 @@ go_deps.gazelle_override(
path = "github.com/googleapis/googleapis",
)

# golang.org/x/tools is not a direct dependency of the go code but is used by nogo
go_deps.module(
path = "golang.org/x/tools",
sum = "h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=",
version = "v0.18.0",
)

### All *direct* Go dependencies of the module have to be listed explicitly.
use_repo(
go_deps,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ require (
golang.org/x/oauth2 v0.20.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.21.0
golang.org/x/tools v0.18.0
google.golang.org/api v0.139.0
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d
Expand Down Expand Up @@ -78,7 +79,6 @@ require (
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.15.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1606,8 +1606,8 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=
golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk=
golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=
golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
1 change: 1 addition & 0 deletions tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ go_library(
"@com_github_pkg_xattr//:xattr",
"@com_google_cloud_go_monitoring//apiv3",
"@com_google_cloud_go_storage//:storage",
"@org_golang_x_tools//go/analysis",
],
)
7 changes: 4 additions & 3 deletions tools/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Define all imports that are only in non-exported code so that
// go.mod and go.sum remain consistent

package tools

import (
// Dependencies of non-exported code, specified here so that
// go.mod and go.sum remain consistent
_ "cloud.google.com/go/monitoring/apiv3"
_ "cloud.google.com/go/storage"
_ "github.com/pkg/xattr"

_ "golang.org/x/tools/go/analysis" // Used as tools by bazel nogo analyzers
)

0 comments on commit 08b212a

Please sign in to comment.