Forráskód Böngészése

Fix broken test due to linter fix

max furman 4 éve
szülő
commit
5f4ac5beff
2 módosított fájl, 2 hozzáadás és 2 törlés
  1. 1 1
      errs/error.go
  2. 1 1
      errs/errors_test.go

+ 1 - 1
errs/error.go

@@ -142,7 +142,7 @@ func (e *Error) UnmarshalJSON(data []byte) error {
 		return err
 	}
 	e.Status = er.Status
-	e.Err = errors.New(er.Message)
+	e.Err = fmt.Errorf("%s", er.Message)
 	return nil
 }
 

+ 1 - 1
errs/errors_test.go

@@ -58,7 +58,7 @@ func TestError_UnmarshalJSON(t *testing.T) {
 				t.Errorf("Error.UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
 			}
 			if !reflect.DeepEqual(tt.expected, e) {
-				t.Errorf("Error.UnmarshalJSON() wants = %v, got %v", tt.expected, e)
+				t.Errorf("Error.UnmarshalJSON() wants = %+v, got %+v", tt.expected, e)
 			}
 		})
 	}