one line method removed

This commit is contained in:
Sam Woodard 2018-10-05 08:56:32 -07:00
parent ab24913148
commit d05fcd97df
1 changed files with 9 additions and 8 deletions

View File

@ -301,7 +301,10 @@ func TestUnmarshalSetsID(t *testing.T) {
func TestUnmarshal_nonNumericID(t *testing.T) { func TestUnmarshal_nonNumericID(t *testing.T) {
data := samplePayloadWithoutIncluded() data := samplePayloadWithoutIncluded()
data["data"].(map[string]interface{})["id"] = "non-numeric-id" 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) in := bytes.NewReader(payload)
out := new(Post) out := new(Post)
@ -402,7 +405,10 @@ func TestUnmarshalInvalidISO8601(t *testing.T) {
} }
func TestUnmarshalRelationshipsWithoutIncluded(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) in := bytes.NewReader(data)
out := new(Post) out := new(Post)
@ -787,7 +793,7 @@ func TestUnmarshalCustomTypeAttributes(t *testing.T) {
}, },
}, },
} }
payload, err := payload(data) payload, err := json.Marshal(data)
if err != nil { if err != nil {
t.Fatal(err) 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 { func samplePayload() io.Reader {
payload := &OnePayload{ payload := &OnePayload{
Data: &Node{ Data: &Node{