Skip to content

Commit

Permalink
Merge pull request #16987 from github/redsun82/go
Browse files Browse the repository at this point in the history
Go/Bazel: use gazelle `go_deps` instead of a vendor directory
  • Loading branch information
redsun82 authored Jul 17, 2024
2 parents a8a4a20 + e469534 commit bf69c76
Show file tree
Hide file tree
Showing 107 changed files with 19 additions and 19,381 deletions.
4 changes: 4 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ use_repo(
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.22.2")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//go/extractor:go.mod")
use_repo(go_deps, "org_golang_x_mod", "org_golang_x_tools")

lfs_files = use_repo_rule("//misc/bazel:lfs.bzl", "lfs_files")

lfs_files(
Expand Down
4 changes: 2 additions & 2 deletions go/extractor/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ go_library(
"//go/extractor/toolchain",
"//go/extractor/trap",
"//go/extractor/util",
"//go/extractor/vendor/golang.org/x/mod/modfile",
"//go/extractor/vendor/golang.org/x/tools/go/packages",
"@org_golang_x_mod//modfile:go_default_library",
"@org_golang_x_tools//go/packages:go_default_library",
],
)

Expand Down
2 changes: 1 addition & 1 deletion go/extractor/dbscheme/BUILD.bazel

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

6 changes: 5 additions & 1 deletion go/extractor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ module github.com/github/codeql-go/extractor

go 1.22.0

// when updating this, run
// bazel run @rules_go//go -- mod tidy
// when adding or removing dependencies, run
// bazel mod tidy
require (
golang.org/x/mod v0.15.0
golang.org/x/mod v0.16.0
golang.org/x/tools v0.18.0
)
4 changes: 2 additions & 2 deletions go/extractor/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=
Expand Down
4 changes: 2 additions & 2 deletions go/extractor/project/BUILD.bazel

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

2 changes: 1 addition & 1 deletion go/extractor/trap/BUILD.bazel

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

4 changes: 2 additions & 2 deletions go/extractor/util/BUILD.bazel

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

27 changes: 0 additions & 27 deletions go/extractor/vendor/golang.org/x/mod/LICENSE

This file was deleted.

22 changes: 0 additions & 22 deletions go/extractor/vendor/golang.org/x/mod/PATENTS

This file was deleted.

This file was deleted.

78 changes: 0 additions & 78 deletions go/extractor/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go

This file was deleted.

21 changes: 0 additions & 21 deletions go/extractor/vendor/golang.org/x/mod/modfile/BUILD.bazel

This file was deleted.

Loading

0 comments on commit bf69c76

Please sign in to comment.