Skip to content

Commit a621743

Browse files
committed
Linting
1 parent 8b39d7e commit a621743

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

coderd/authzquery/methods_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func splitResp(t *testing.T, values []reflect.Value) ([]reflect.Value, error) {
206206
outputs = append(outputs, r)
207207
}
208208
t.Fatal("no expected error value found in responses (error can be nil)")
209-
panic("unreachable") // For compile reasons
209+
return nil, nil // unreachable, required to compile
210210
}
211211

212212
// A MethodCase contains the inputs to be provided to a single method call,

coderd/coderdtest/authorize.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ func (r *RecordingAuthorizer) AssertActor(t *testing.T, actor rbac.Subject, did
638638
assert.Equalf(t, len(did), ptr, "assert actor: didn't find all actions, %d missing actions", len(did)-ptr)
639639
}
640640

641-
func (r *RecordingAuthorizer) RecordAuthorize(ctx context.Context, subject rbac.Subject, action rbac.Action, object rbac.Object) {
641+
func (r *RecordingAuthorizer) RecordAuthorize(subject rbac.Subject, action rbac.Action, object rbac.Object) {
642642
r.Lock()
643643
defer r.Unlock()
644644
r.Called = append(r.Called, authCall{
@@ -649,7 +649,7 @@ func (r *RecordingAuthorizer) RecordAuthorize(ctx context.Context, subject rbac.
649649
}
650650

651651
func (r *RecordingAuthorizer) Authorize(ctx context.Context, subject rbac.Subject, action rbac.Action, object rbac.Object) error {
652-
r.RecordAuthorize(ctx, subject, action, object)
652+
r.RecordAuthorize(subject, action, object)
653653
if r.Wrapped == nil {
654654
panic("Developer error: RecordingAuthorizer.Wrapped is nil")
655655
}
@@ -705,7 +705,7 @@ func (s *PreparedRecorder) Authorize(ctx context.Context, object rbac.Object) er
705705
defer s.rw.Unlock()
706706

707707
if !s.usingSQL {
708-
s.rec.RecordAuthorize(ctx, s.subject, s.action, object)
708+
s.rec.RecordAuthorize(s.subject, s.action, object)
709709
}
710710
return s.prepped.Authorize(ctx, object)
711711
}
@@ -731,7 +731,7 @@ func (f *fakePreparedAuthorizer) Authorize(ctx context.Context, object rbac.Obje
731731

732732
// CompileToSQL returns a compiled version of the authorizer that will work for
733733
// in memory databases. This fake version will not work against a SQL database.
734-
func (f *fakePreparedAuthorizer) CompileToSQL(_ context.Context, _ regosql.ConvertConfig) (string, error) {
734+
func (*fakePreparedAuthorizer) CompileToSQL(_ context.Context, _ regosql.ConvertConfig) (string, error) {
735735
return "not a valid sql string", nil
736736
}
737737

@@ -746,10 +746,6 @@ func (d *FakeAuthorizer) Authorize(_ context.Context, _ rbac.Subject, _ rbac.Act
746746
return d.AlwaysReturn
747747
}
748748

749-
func (d *FakeAuthorizer) CompileToSQL(_ context.Context, _ regosql.ConvertConfig) (string, error) {
750-
return "not a valid sql string", nil
751-
}
752-
753749
func (d *FakeAuthorizer) Prepare(_ context.Context, subject rbac.Subject, action rbac.Action, _ string) (rbac.PreparedAuthorized, error) {
754750
return &fakePreparedAuthorizer{
755751
Original: d,

0 commit comments

Comments
 (0)