From d05fcd97df612b980b0bcecbfd8939dc22ecca32 Mon Sep 17 00:00:00 2001 From: Sam Woodard Date: Fri, 5 Oct 2018 08:56:32 -0700 Subject: [PATCH] one line method removed --- request_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/request_test.go b/request_test.go index 6fb8a7e..6e7870b 100644 --- a/request_test.go +++ b/request_test.go @@ -301,7 +301,10 @@ func TestUnmarshalSetsID(t *testing.T) { func TestUnmarshal_nonNumericID(t *testing.T) { data := samplePayloadWithoutIncluded() data["data"].(map[string]interface{})["id"] = "non-numeric-id" - payload, _ := payload(data) + payload, err := json.Marshal(data) + if err != nil { + t.Fatal(err) + } in := bytes.NewReader(payload) out := new(Post) @@ -402,7 +405,10 @@ func TestUnmarshalInvalidISO8601(t *testing.T) { } func TestUnmarshalRelationshipsWithoutIncluded(t *testing.T) { - data, _ := payload(samplePayloadWithoutIncluded()) + data, err := json.Marshal(samplePayloadWithoutIncluded()) + if err != nil { + t.Fatal(err) + } in := bytes.NewReader(data) out := new(Post) @@ -787,7 +793,7 @@ func TestUnmarshalCustomTypeAttributes(t *testing.T) { }, }, } - payload, err := payload(data) + payload, err := json.Marshal(data) if err != nil { t.Fatal(err) } @@ -849,11 +855,6 @@ func samplePayloadWithoutIncluded() map[string]interface{} { } } -func payload(data map[string]interface{}) (result []byte, err error) { - result, err = json.Marshal(data) - return -} - func samplePayload() io.Reader { payload := &OnePayload{ Data: &Node{