run gofmt

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2018-06-06 12:04:28 -04:00
parent 3ad96f60b4
commit eaf071b3ef
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3
2 changed files with 9 additions and 5 deletions

View file

@ -32,7 +32,7 @@ func parseChallenge(challengeHeader string) (*authService, error) {
if d := len(match); d != 1 {
return nil, fmt.Errorf("malformed auth challenge header: '%s', %d", challengeHeader, d)
}
parts := strings.SplitN(strings.TrimSpace(match[0][1]), ",",3)
parts := strings.SplitN(strings.TrimSpace(match[0][1]), ",", 3)
var realm, service string
var scope []string

View file

@ -21,7 +21,11 @@ func (asm authServiceMock) equalTo(v *authService) bool {
if asm.service != v.Service {
return false
}
for i, v := range v.Scope { if v != asm.scope[i] { return false } }
for i, v := range v.Scope {
if v != asm.scope[i] {
return false
}
}
if asm.realm != v.Realm.String() {
return false
@ -57,9 +61,9 @@ func TestParseChallengePush(t *testing.T) {
{
header: `Bearer realm="https://foo.com/v2/token",service="foo.com",scope="repository:pdr/tls:pull,push"`,
value: authServiceMock{
realm: "https://foo.com/v2/token",
service: "foo.com",
scope: []string{"repository:pdr/tls:pull,push"},
realm: "https://foo.com/v2/token",
service: "foo.com",
scope: []string{"repository:pdr/tls:pull,push"},
},
},
}