aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devtools/cmd/seeddb/main.go2
-rw-r--r--internal/derrors/derrors_test.go1
-rw-r--r--internal/fetch/package.go1
-rw-r--r--internal/frontend/search.go1
-rw-r--r--internal/postgres/search.go1
-rw-r--r--internal/postgres/symbolsearch.go4
-rw-r--r--internal/symbol/generate.go1
-rw-r--r--internal/vuln/client.go1
-rw-r--r--internal/worker/fetch.go1
-rw-r--r--internal/worker/server.go1
10 files changed, 0 insertions, 14 deletions
diff --git a/devtools/cmd/seeddb/main.go b/devtools/cmd/seeddb/main.go
index 623b37b4..0658d5f8 100644
--- a/devtools/cmd/seeddb/main.go
+++ b/devtools/cmd/seeddb/main.go
@@ -125,8 +125,6 @@ func run(ctx context.Context, db *database.DB, proxyURL string) error {
log.Printf("fetching")
for path, vers := range versionsByPath {
- path := path
- vers := vers
// Process versions of the same module sequentially, to avoid DB contention.
g.Go(func() error {
for _, v := range vers {
diff --git a/internal/derrors/derrors_test.go b/internal/derrors/derrors_test.go
index ab2db26c..844b64ec 100644
--- a/internal/derrors/derrors_test.go
+++ b/internal/derrors/derrors_test.go
@@ -33,7 +33,6 @@ func TestFromHTTPStatus(t *testing.T) {
}
for _, test := range tests {
- test := test
t.Run(test.label, func(t *testing.T) {
err := FromStatus(test.status, "error")
if !errors.Is(err, test.want) {
diff --git a/internal/fetch/package.go b/internal/fetch/package.go
index f8f5594e..eacfc6f8 100644
--- a/internal/fetch/package.go
+++ b/internal/fetch/package.go
@@ -288,7 +288,6 @@ func extractPackageMetas(ctx context.Context, modulePath, resolvedVersion string
var mu sync.Mutex // guards pkgs, incompleteDirs, packageVersionStates
var errgroup errgroup.Group
for innerPath, goFiles := range dirs {
- innerPath, goFiles := innerPath, goFiles
errgroup.Go(func() error {
var addedPackage bool
mu.Lock()
diff --git a/internal/frontend/search.go b/internal/frontend/search.go
index c4625f67..0dac8417 100644
--- a/internal/frontend/search.go
+++ b/internal/frontend/search.go
@@ -580,7 +580,6 @@ func addVulns(ctx context.Context, rs []*SearchResult, vc *vuln.Client) {
var wg sync.WaitGroup
// TODO(golang/go#48223): throttle concurrency?
for _, r := range rs {
- r := r
wg.Add(1)
go func() {
defer wg.Done()
diff --git a/internal/postgres/search.go b/internal/postgres/search.go
index 4015aa73..bdc2c30d 100644
--- a/internal/postgres/search.go
+++ b/internal/postgres/search.go
@@ -235,7 +235,6 @@ func (db *DB) hedgedSearch(ctx context.Context, q string, limit int, opts Search
// Fan out our search requests.
for _, s := range searchers {
- s := s
go func() {
start := time.Now()
resp := s(db, searchCtx, q, limit, opts)
diff --git a/internal/postgres/symbolsearch.go b/internal/postgres/symbolsearch.go
index 7b36b7e4..f1a273e6 100644
--- a/internal/postgres/symbolsearch.go
+++ b/internal/postgres/symbolsearch.go
@@ -170,8 +170,6 @@ func runSymbolSearchMultiWord(ctx context.Context, ddb *database.DB, q string, l
resultsArray := make([][]*SearchResult, len(symbolToPathTokens))
count := 0
for symbol, pathTokens := range symbolToPathTokens {
- symbol := symbol
- pathTokens := pathTokens
i := count
count += 1
group.Go(func() error {
@@ -265,8 +263,6 @@ func runSymbolSearchOneDot(ctx context.Context, ddb *database.DB, q string, limi
search.SearchTypeSymbol,
search.SearchTypePackageDotSymbol,
} {
- i := i
- st := st
group.Go(func() error {
var (
results []*SearchResult
diff --git a/internal/symbol/generate.go b/internal/symbol/generate.go
index 8b69a9e8..71e0e5ff 100644
--- a/internal/symbol/generate.go
+++ b/internal/symbol/generate.go
@@ -41,7 +41,6 @@ func GenerateFeatureContexts(ctx context.Context, pkgPath, pkgDir string) (map[s
var wg sync.WaitGroup
walkers := make([]*Walker, len(internal.BuildContexts))
for i, context := range contexts {
- i, context := i, context
wg.Add(1)
go func() {
defer wg.Done()
diff --git a/internal/vuln/client.go b/internal/vuln/client.go
index ae7c4fae..561835dd 100644
--- a/internal/vuln/client.go
+++ b/internal/vuln/client.go
@@ -314,7 +314,6 @@ func (c *Client) byIDs(ctx context.Context, ids []string) (_ []*osv.Entry, err e
g, gctx := errgroup.WithContext(ctx)
g.SetLimit(10)
for i, id := range ids {
- i, id := i, id
g.Go(func() error {
e, err := c.ByID(gctx, id)
if err != nil {
diff --git a/internal/worker/fetch.go b/internal/worker/fetch.go
index 11989ec3..a063ef9a 100644
--- a/internal/worker/fetch.go
+++ b/internal/worker/fetch.go
@@ -470,7 +470,6 @@ func updateVersionMap(ctx context.Context, db *postgres.DB, ft *fetchTask) (err
requestedVersions = append(requestedVersions, internal.MasterVersion)
}
for _, v := range requestedVersions {
- v := v
vm := &internal.VersionMap{
ModulePath: ft.ModulePath,
RequestedVersion: v,
diff --git a/internal/worker/server.go b/internal/worker/server.go
index 736e729f..9edd93c5 100644
--- a/internal/worker/server.go
+++ b/internal/worker/server.go
@@ -522,7 +522,6 @@ func (s *Server) Enqueue(ctx context.Context, w http.ResponseWriter, limit int,
)
sem := make(chan struct{}, concurrentEnqueues)
for _, m := range modules {
- m := m
opts := queue.Options{
Suffix: suffix,
DisableProxyFetch: shouldDisableProxyFetch(m),