Skip to content

Commit f567749

Browse files
linting
1 parent 50b4fb3 commit f567749

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

ssas/service/tokendenylist_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package service
33
import (
44
"context"
55
"crypto/rand"
6+
"database/sql"
67
"math/big"
78
"strconv"
89
"testing"
@@ -45,9 +46,12 @@ func (s *TokenCacheTestSuite) SetupTest() {
4546
}
4647

4748
func (s *TokenCacheTestSuite) TearDownTest() {
49+
var err error
50+
var db *sql.DB
4851
s.d.c.Flush()
49-
err := s.db.Exec("DELETE FROM denylist_entries;").Error
50-
db, err := s.db.DB()
52+
err = s.db.Exec("DELETE FROM denylist_entries;").Error
53+
require.NoError(s.T(), err)
54+
db, err = s.db.DB()
5155
require.NoError(s.T(), err)
5256
db.Close()
5357
assert.Nil(s.T(), err)

ssas/systems.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,9 @@ func (r *SystemsRepository) registerSystem(ctx context.Context, input SystemInpu
512512
}
513513

514514
var group Group
515-
if err := tx.WithContext(ctx).First(&group, "group_id = ?", input.GroupID).Error; err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
516-
err = fmt.Errorf("no Group record found for groupID %s", input.GroupID)
515+
err = tx.WithContext(ctx).First(&group, "group_id = ?", input.GroupID).Error
516+
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
517+
return creds, fmt.Errorf("no Group record found for groupID %s", input.GroupID)
517518
}
518519

519520
system := System{

0 commit comments

Comments
 (0)