Move private registry sources out of util package

This commit is contained in:
Michael B. Gale
2026-02-02 14:45:06 +00:00
parent 29930fa6bf
commit 6d67e419ff
6 changed files with 24 additions and 6 deletions

16
go/extractor/registries/BUILD.bazel generated Normal file
View File

@@ -0,0 +1,16 @@
# generated running `bazel run //go/gazelle`, do not edit
load("@rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "registries",
srcs = ["registryproxy.go"],
importpath = "github.com/github/codeql-go/extractor/registries",
visibility = ["//visibility:public"],
)
go_test(
name = "registries_test",
srcs = ["registryproxy_test.go"],
embed = [":registries"],
)

View File

@@ -1,4 +1,4 @@
package util
package registries
import (
"encoding/json"

View File

@@ -1,4 +1,4 @@
package util
package registries
import (
"testing"

View File

@@ -7,7 +7,10 @@ go_library(
srcs = ["toolchain.go"],
importpath = "github.com/github/codeql-go/extractor/toolchain",
visibility = ["//visibility:public"],
deps = ["//go/extractor/util"],
deps = [
"//go/extractor/registries",
"//go/extractor/util",
],
)
go_test(

View File

@@ -10,6 +10,7 @@ import (
"path/filepath"
"strings"
"github.com/github/codeql-go/extractor/registries"
"github.com/github/codeql-go/extractor/util"
)
@@ -140,7 +141,7 @@ func SupportsWorkspaces() bool {
// Constructs a `*exec.Cmd` for `go` with the specified arguments.
func GoCommand(arg ...string) *exec.Cmd {
cmd := exec.Command("go", arg...)
util.ApplyProxyEnvVars(cmd)
registries.ApplyProxyEnvVars(cmd)
return cmd
}

View File

@@ -8,7 +8,6 @@ go_library(
"extractvendordirs.go",
"logging.go",
"overlays.go",
"registryproxy.go",
"semver.go",
"util.go",
],
@@ -21,7 +20,6 @@ go_test(
name = "util_test",
srcs = [
"logging_test.go",
"registryproxy_test.go",
"semver_test.go",
"util_test.go",
],