@@ -301,7 +301,10 @@ func TestUnmarshalSetsID(t *testing.T) {
301
301
func TestUnmarshal_nonNumericID (t * testing.T ) {
302
302
data := samplePayloadWithoutIncluded ()
303
303
data ["data" ].(map [string ]interface {})["id" ] = "non-numeric-id"
304
- payload , _ := payload (data )
304
+ payload , err := json .Marshal (data )
305
+ if err != nil {
306
+ t .Fatal (err )
307
+ }
305
308
in := bytes .NewReader (payload )
306
309
out := new (Post )
307
310
@@ -402,7 +405,10 @@ func TestUnmarshalInvalidISO8601(t *testing.T) {
402
405
}
403
406
404
407
func TestUnmarshalRelationshipsWithoutIncluded (t * testing.T ) {
405
- data , _ := payload (samplePayloadWithoutIncluded ())
408
+ data , err := json .Marshal (samplePayloadWithoutIncluded ())
409
+ if err != nil {
410
+ t .Fatal (err )
411
+ }
406
412
in := bytes .NewReader (data )
407
413
out := new (Post )
408
414
@@ -787,7 +793,7 @@ func TestUnmarshalCustomTypeAttributes(t *testing.T) {
787
793
},
788
794
},
789
795
}
790
- payload , err := payload (data )
796
+ payload , err := json . Marshal (data )
791
797
if err != nil {
792
798
t .Fatal (err )
793
799
}
@@ -849,11 +855,6 @@ func samplePayloadWithoutIncluded() map[string]interface{} {
849
855
}
850
856
}
851
857
852
- func payload (data map [string ]interface {}) (result []byte , err error ) {
853
- result , err = json .Marshal (data )
854
- return
855
- }
856
-
857
858
func samplePayload () io.Reader {
858
859
payload := & OnePayload {
859
860
Data : & Node {
0 commit comments