Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit d05fcd9

Browse files
committed
one line method removed
1 parent ab24913 commit d05fcd9

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

request_test.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,10 @@ func TestUnmarshalSetsID(t *testing.T) {
301301
func 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

404407
func 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-
857858
func samplePayload() io.Reader {
858859
payload := &OnePayload{
859860
Data: &Node{

0 commit comments

Comments
 (0)