Skip to content

Commit

Permalink
Add a dependency on x/tools
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed Jul 5, 2024
1 parent 13c5300 commit 03ad6ca
Show file tree
Hide file tree
Showing 75 changed files with 31,386 additions and 12 deletions.
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ go_deps.from_file(go_mod = "//:go.mod")
# but bazel buildtools and nogo depend on it.
go_deps.module(
path = "golang.org/x/tools",
sum = "h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=",
version = "v0.18.0",
sum = "h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=",
version = "v0.22.0",
)
use_repo(
go_deps,
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/pmezard/go-difflib v1.0.0
golang.org/x/mod v0.19.0
golang.org/x/sync v0.7.0
golang.org/x/tools v0.22.0
golang.org/x/tools/go/vcs v0.1.0-deprecated
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
golang.org/x/tools/go/vcs v0.1.0-deprecated h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4=
golang.org/x/tools/go/vcs v0.1.0-deprecated/go.mod h1:zUrvATBAvEI9535oC0yWYsLsHIV4Z7g63sNPVMtuBy8=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
1 change: 1 addition & 0 deletions language/go/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ go_library(
"@org_golang_x_mod//modfile",
"@org_golang_x_mod//module",
"@org_golang_x_sync//errgroup",
"@org_golang_x_tools//go/packages",
],
)

Expand Down
13 changes: 3 additions & 10 deletions language/go/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

"github.com/bazelbuild/bazel-gazelle/label"
"github.com/bazelbuild/bazel-gazelle/rule"
"golang.org/x/tools/go/packages"
)

// goListModules invokes "go list" in a directory containing a go.mod file.
Expand All @@ -49,16 +50,8 @@ var goModDownload = func(dir string, args []string) ([]byte, error) {
// modulesFromList is an abstraction to preserve the output of `go list`.
// The output schema is documented at https://go.dev/ref/mod#go-list-m
type moduleFromList struct {
Path, Version, Sum string
Main bool
Replace *struct {
Path, Version string
}
Error *moduleError
}

type moduleError struct {
Err string
packages.Module
Sum string
}

// moduleFromDownload is an abstraction to preserve the output of `go mod download`.
Expand Down
27 changes: 27 additions & 0 deletions vendor/golang.org/x/tools/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions vendor/golang.org/x/tools/PATENTS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

186 changes: 186 additions & 0 deletions vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions vendor/golang.org/x/tools/go/gcexportdata/importer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 03ad6ca

Please sign in to comment.