Skip to content

Commit

Permalink
fix golang lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Lucchesi committed Aug 28, 2022
1 parent 45433c7 commit 9b9eaf7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions errors/error_type.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package errors

const (
// ClientIDRequired is a constant for the client id required error.
CustumerIDRequired = "CUSTUMER_ID_REQUIRED"
CardIDRequired = "CARD_ID_REQUIRED"
// CustomerIDRequired is the error message when the customer id is required
CustomerIDRequired = "CUSTUMER_ID_REQUIRED"
// CardIDRequired is a constant for the card id required error.
CardIDRequired = "CARD_ID_REQUIRED"
// PageAndSizeRequired is a constant for the page and size required error.
PageAndSizeRequired = "PAGE_AND_SIZE_REQUIRED"
)
2 changes: 1 addition & 1 deletion pagarme/create_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (i *Instance) CreateCard(ctx context.Context, clientID string, card *types.
if clientID == "" {
return "", &errors.Error{
ErrorCode: 400,
ErrorMessage: errors.CustumerIDRequired,
ErrorMessage: errors.CustomerIDRequired,
}
}

Expand Down
2 changes: 1 addition & 1 deletion pagarme/create_card_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestCreateNewCardWithoutClientID(t *testing.T) {

expectedError := customError.Error{
ErrorCode: 400,
ErrorMessage: customError.CustumerIDRequired,
ErrorMessage: customError.CustomerIDRequired,
}

if responseErr.Error() != expectedError.Error() {
Expand Down
2 changes: 1 addition & 1 deletion pagarme/edit_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (i *Instance) EditClient(ctx context.Context, clientID string, client *type
if clientID == "" {
return "", &errors.Error{
ErrorCode: 400,
ErrorMessage: errors.CustumerIDRequired,
ErrorMessage: errors.CustomerIDRequired,
}
}

Expand Down
2 changes: 1 addition & 1 deletion pagarme/edit_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestEditClientWithoutClientID(t *testing.T) {

expectedError := customError.Error{
ErrorCode: 400,
ErrorMessage: customError.CustumerIDRequired,
ErrorMessage: customError.CustomerIDRequired,
}

if responseErr.Error() != expectedError.Error() {
Expand Down
3 changes: 2 additions & 1 deletion pagarme/get_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/lucchesisp/pagarme-go/errors"
)

// GetCard returns the card with the given cardID and customerID.
func (i *Instance) GetCard(ctx context.Context, cardID string, customerID string) (string, error) {
if cardID == "" {
return "", &errors.Error{
Expand All @@ -17,7 +18,7 @@ func (i *Instance) GetCard(ctx context.Context, cardID string, customerID string
if customerID == "" {
return "", &errors.Error{
ErrorCode: 400,
ErrorMessage: errors.CustumerIDRequired,
ErrorMessage: errors.CustomerIDRequired,
}
}

Expand Down
2 changes: 1 addition & 1 deletion pagarme/get_card_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func TestGetCardWithoutCustomerID(t *testing.T) {

expectedError := &customError.Error{
ErrorCode: 400,
ErrorMessage: customError.CustumerIDRequired,
ErrorMessage: customError.CustomerIDRequired,
}

if responseErr.Error() != expectedError.Error() {
Expand Down

0 comments on commit 9b9eaf7

Please sign in to comment.