Skip to content

Commit

Permalink
Resolving style comments by Easwar
Browse files Browse the repository at this point in the history
  • Loading branch information
purnesh42H committed May 7, 2024
1 parent 20c42a3 commit 0aacf4f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions codes/codes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package codes

import (
"encoding/json"
"errors"
"reflect"
"testing"

Expand Down Expand Up @@ -93,10 +94,10 @@ func (s) TestUnmarshalJSON_MarshalUnmarshal(t *testing.T) {
}

func (s) TestUnmarshalJSON_InvalidIntegerCode(t *testing.T) {
wantErr := errors.New("invalid code: 200") // for integer invalid code, expect integer value in error message

var got Code
wantErr := "invalid code: 200" // for integer invalid code, expect integer value in error message
err := got.UnmarshalJSON([]byte("200"))
if err.Error() != wantErr {
t.Errorf("got.UnmarshalJSON(200) != %s; got=%s", wantErr, err.Error())
if err := got.UnmarshalJSON([]byte("200")); wantErr.Error() != err.Error() {
t.Errorf("got.UnmarshalJSON(200) != %v; wantErr: %v", err, wantErr)
}
}

0 comments on commit 0aacf4f

Please sign in to comment.