Skip to content

Commit

Permalink
style: lint + format
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeshong committed Nov 21, 2024
1 parent b5f24cd commit 4169d32
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,4 @@ func networkPassageError(message string) PassageError {
StatusCode: 500,
ErrorCode: "Internal Service Error",
}
}
}
6 changes: 2 additions & 4 deletions app_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ func TestUpdate(t *testing.T) {
_, err = psg.User.Update(PassageUserID, updateBody)
require.NotNil(t, err)
expectedMessage := "failed to update Passage User's attributes"
expectedErrorText := "error: identifier: must be a valid E164 number.; identifier: must be a valid email address."
passageBadRequestAsserts(t, err, expectedMessage, expectedErrorText)
passageBadRequestAsserts(t, err, expectedMessage)
})

t.Run("Error: not found", func(t *testing.T) {
Expand Down Expand Up @@ -369,8 +368,7 @@ func TestCreate(t *testing.T) {

require.NotNil(t, err)
expectedMessage := "failed to create Passage User"
expectedErrorText := "error: email: cannot be blank; phone: cannot be blank."
passageBadRequestAsserts(t, err, expectedMessage, expectedErrorText)
passageBadRequestAsserts(t, err, expectedMessage)
})

t.Run("Error: unauthorized", func(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion passage_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type PassageError struct {
ErrorCode string
}


func (e PassageError) Error() string {
var ps strings.Builder
ps.WriteString("Passage Error - ")
Expand Down
2 changes: 1 addition & 1 deletion passage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func passageUnauthorizedAsserts(t *testing.T, err error, message string) {
assert.Equal(t, "error_code: invalid_access_token", splitError[2])
}

func passageBadRequestAsserts(t *testing.T, err error, message, errorText string) {
func passageBadRequestAsserts(t *testing.T, err error, message string) {
splitError := strings.Split(err.Error(), ", ")
assert.Len(t, splitError, 3)
assert.Equal(t, "Passage Error - message: "+message, splitError[0])
Expand Down

0 comments on commit 4169d32

Please sign in to comment.