Skip to content

Commit 5007f7c

Browse files
committed
fix(test): add return after t.Fatal in more nil-checks for staticcheck SA5011
1 parent 1c49802 commit 5007f7c

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

cmd/sluice/cred_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,7 @@ func TestHandleCredAddOAuthWithoutDestination(t *testing.T) {
10331033
}
10341034
if meta == nil {
10351035
t.Fatal("expected credential_meta even without --destination")
1036+
return
10361037
}
10371038
if meta.CredType != "oauth" {
10381039
t.Errorf("cred_type = %q, want oauth", meta.CredType)

internal/api/server_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,7 @@ func TestPostApiCredentials_OAuthSuccess(t *testing.T) {
17031703
}
17041704
if meta == nil {
17051705
t.Fatal("expected credential meta to exist")
1706+
return
17061707
}
17071708
if meta.CredType != "oauth" {
17081709
t.Errorf("expected cred_type oauth, got %q", meta.CredType)
@@ -2016,6 +2017,7 @@ func TestPostApiCredentials_StaticWithMetaCreated(t *testing.T) {
20162017
}
20172018
if meta == nil {
20182019
t.Fatal("expected credential meta to exist")
2020+
return
20192021
}
20202022
if meta.CredType != "static" {
20212023
t.Errorf("expected cred_type static, got %q", meta.CredType)

0 commit comments

Comments
 (0)