Skip to content
This repository was archived by the owner on Nov 22, 2020. It is now read-only.
This repository was archived by the owner on Nov 22, 2020. It is now read-only.

DavadDi/grpclb: vendor/github.com/coreos/etcd/auth/store_test.go; 12 LoC #837

Description

@githubvet

Found a possible issue in DavadDi/grpclb at vendor/github.com/coreos/etcd/auth/store_test.go

The below snippet of Go code triggered static analysis which searches for goroutines and/or defer statements
which capture loop variables.

Click here to see the code in its original context.

Click here to show the 13 line(s) of Go which triggered the analyzer.
		for u := range users {
			go func(user string) {
				defer wg.Done()
				token := fmt.Sprintf("%s(%d)", user, i)
				ctx := context.WithValue(context.WithValue(context.TODO(), AuthenticateParamIndex{}, uint64(1)), AuthenticateParamSimpleTokenPrefix{}, token)
				if _, err := as.Authenticate(ctx, user, "123"); err != nil {
					t.Fatal(err)
				}
				if _, err := as.AuthInfoFromCtx(ctx); err != nil {
					t.Fatal(err)
				}
			}(u)
		}

commit ID: 530387db8022c2ed50c182066b449cc830319fa7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions