Skip to content

Commit

Permalink
Merge pull request cesanta#283 from porty/fix-go-vet-failures
Browse files Browse the repository at this point in the history
Fix go vet failures
  • Loading branch information
rojer authored Oct 2, 2020
2 parents 519c5d7 + faa3dca commit 2364d5f
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 2364d5f

Please sign in to comment.