diff --git a/registry/client/auth/authchallenge.go b/registry/client/auth/authchallenge.go index 4dbda9e03..e8cdef7f2 100644 --- a/registry/client/auth/authchallenge.go +++ b/registry/client/auth/authchallenge.go @@ -49,9 +49,9 @@ func NewSimpleChallengeManager() ChallengeManager { } } -type simpleChallengeManager struct{ +type simpleChallengeManager struct { sync.RWMutex - Challanges map[string][]Challenge + Challanges map[string][]Challenge } func (m *simpleChallengeManager) GetChallenges(endpoint url.URL) ([]Challenge, error) { diff --git a/registry/client/auth/authchallenge_test.go b/registry/client/auth/authchallenge_test.go index f1b321a74..862b717b4 100644 --- a/registry/client/auth/authchallenge_test.go +++ b/registry/client/auth/authchallenge_test.go @@ -5,8 +5,8 @@ import ( "net/http" "net/url" "strings" - "testing" "sync" + "testing" ) func TestAuthChallengeParse(t *testing.T) { @@ -82,7 +82,6 @@ func testAuthChallengeNormalization(t *testing.T, host string) { } } - func testAuthChallengeConcurrent(t *testing.T, host string) { scm := NewSimpleChallengeManager() @@ -104,7 +103,7 @@ func testAuthChallengeConcurrent(t *testing.T, host string) { s.Add(2) go func() { - for i:=0 ; i<200; i++ { + for i := 0; i < 200; i++ { err = scm.AddResponse(resp) if err != nil { t.Fatal(err) @@ -115,7 +114,7 @@ func testAuthChallengeConcurrent(t *testing.T, host string) { go func() { lowered := *url lowered.Host = strings.ToLower(lowered.Host) - for k := 0; k < 200 ; k++ { + for k := 0; k < 200; k++ { _, err := scm.GetChallenges(lowered) if err != nil { t.Fatal(err)