Skip to content

Commit

Permalink
Error comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
folone committed Feb 5, 2024
1 parent 8861974 commit 1d65457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions secrets/secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package secrets

import (
"bytes"
"errors"
"reflect"
"testing"
)
Expand Down Expand Up @@ -234,8 +235,7 @@ func TestSecretsWrongType(t *testing.T) {
if err != nil {
t.Fatal(err)
}
_, err = tt.function(secrets)
if tt.expectedError != nil && err.Error() != tt.expectedError.Error() {
if _, err := tt.function(secrets); !errors.Is(err, tt.expectedError) {
t.Fatalf("expected error %v, actual: %v", tt.expectedError, err)
}
})
Expand Down

0 comments on commit 1d65457

Please sign in to comment.