@@ -301,7 +301,10 @@ func TestUnmarshalSetsID(t *testing.T) {
301301func TestUnmarshal_nonNumericID (t * testing.T ) {
302302 data := samplePayloadWithoutIncluded ()
303303 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+ }
305308 in := bytes .NewReader (payload )
306309 out := new (Post )
307310
@@ -402,7 +405,10 @@ func TestUnmarshalInvalidISO8601(t *testing.T) {
402405}
403406
404407func TestUnmarshalRelationshipsWithoutIncluded (t * testing.T ) {
405- data , _ := payload (samplePayloadWithoutIncluded ())
408+ data , err := json .Marshal (samplePayloadWithoutIncluded ())
409+ if err != nil {
410+ t .Fatal (err )
411+ }
406412 in := bytes .NewReader (data )
407413 out := new (Post )
408414
@@ -787,7 +793,7 @@ func TestUnmarshalCustomTypeAttributes(t *testing.T) {
787793 },
788794 },
789795 }
790- payload , err := payload (data )
796+ payload , err := json . Marshal (data )
791797 if err != nil {
792798 t .Fatal (err )
793799 }
@@ -849,11 +855,6 @@ func samplePayloadWithoutIncluded() map[string]interface{} {
849855 }
850856}
851857
852- func payload (data map [string ]interface {}) (result []byte , err error ) {
853- result , err = json .Marshal (data )
854- return
855- }
856-
857858func samplePayload () io.Reader {
858859 payload := & OnePayload {
859860 Data : & Node {
0 commit comments