Skip to content

Commit

Permalink
Fix go vet failures
Browse files Browse the repository at this point in the history
  • Loading branch information
porty committed Jun 30, 2020
1 parent 6950efb commit faa3dca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion auth_server/authz/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ func (aa *aclAuthorizer) Authorize(ai *api.AuthRequestInfo) ([]string, error) {
for _, e := range aa.acl {
matched := e.Matches(ai)
if matched {
glog.V(2).Infof("%s matched %s (Comment: %s)", ai, e, e.Comment)
comment := "(nil)"
if e.Comment != nil {
comment = *e.Comment
}
glog.V(2).Infof("%s matched %s (Comment: %s)", ai, e, comment)
if len(*e.Actions) == 1 && (*e.Actions)[0] == "*" {
return ai.Actions, nil
}
Expand Down
4 changes: 2 additions & 2 deletions auth_server/authz/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ func TestValidation(t *testing.T) {
for i, c := range cases {
result := validateMatchConditions(&c.mc)
if c.ok && result != nil {
t.Errorf("%d: %q: expected to pass, got %s", i, c.mc, result)
t.Errorf("%d: %v: expected to pass, got %s", i, c.mc, result)
} else if !c.ok && result == nil {
t.Errorf("%d: %q: expected to fail, but it passed", i, c.mc)
t.Errorf("%d: %v: expected to fail, but it passed", i, c.mc)
}
}
}
Expand Down

0 comments on commit faa3dca

Please sign in to comment.