Skip to content

Commit 50ca50d

Browse files
committed
Rename proxy_configs to goproxy_servers and only store URLs
1 parent ed9ed43 commit 50ca50d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

go/extractor/util/registryproxy.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ var proxy_address string
2626
// The path to the temporary file that stores the proxy certificate, if any.
2727
var proxy_cert_file string
2828

29-
// An array of registry configurations that are relevant to Go.
30-
// This excludes other registry configurations that may be available, but are not relevant to Go.
31-
var proxy_configs []RegistryConfig
29+
// An array of goproxy server URLs.
30+
var goproxy_servers []string
3231

3332
// Stores the environment variables that we wish to pass on to `go` commands.
3433
var proxy_vars []string = nil
@@ -91,16 +90,16 @@ func getEnvVars() []string {
9190
// filter others out at this point.
9291
for _, cfg := range val {
9392
if cfg.Type == GOPROXY_SERVER {
94-
proxy_configs = append(proxy_configs, cfg)
93+
goproxy_servers = append(goproxy_servers, cfg.URL)
9594
slog.Info("Found GOPROXY server", slog.String("url", cfg.URL))
9695
}
9796
}
9897

99-
if len(proxy_configs) > 0 {
98+
if len(goproxy_servers) > 0 {
10099
goproxy_val := "https://proxy.golang.org,direct"
101100

102-
for _, cfg := range proxy_configs {
103-
goproxy_val = cfg.URL + "," + goproxy_val
101+
for _, url := range goproxy_servers {
102+
goproxy_val = url + "," + goproxy_val
104103
}
105104

106105
result = append(result, fmt.Sprintf("GOPROXY=%s", goproxy_val), "GOPRIVATE=", "GONOPROXY=")

0 commit comments

Comments
 (0)