From 4169d3224e88e28a79ea97a3184cead307c02476 Mon Sep 17 00:00:00 2001 From: Tamara Deshong Date: Thu, 21 Nov 2024 13:40:13 -0500 Subject: [PATCH] style: lint + format --- app_user.go | 2 +- app_user_test.go | 6 ++---- passage_error.go | 1 - passage_test.go | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app_user.go b/app_user.go index f79b9d7..93a1e5a 100644 --- a/app_user.go +++ b/app_user.go @@ -370,4 +370,4 @@ func networkPassageError(message string) PassageError { StatusCode: 500, ErrorCode: "Internal Service Error", } -} \ No newline at end of file +} diff --git a/app_user_test.go b/app_user_test.go index 2072aa8..559af48 100644 --- a/app_user_test.go +++ b/app_user_test.go @@ -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) { @@ -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) { diff --git a/passage_error.go b/passage_error.go index e1fa768..ae519f0 100644 --- a/passage_error.go +++ b/passage_error.go @@ -11,7 +11,6 @@ type PassageError struct { ErrorCode string } - func (e PassageError) Error() string { var ps strings.Builder ps.WriteString("Passage Error - ") diff --git a/passage_test.go b/passage_test.go index a4546f6..3e7693f 100644 --- a/passage_test.go +++ b/passage_test.go @@ -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])