From e16653629ac3685f76ed32de48ad27778622d57a Mon Sep 17 00:00:00 2001 From: Steve Kaliski Date: Mon, 26 Mar 2018 20:52:10 -0400 Subject: [PATCH] resolve error when using json encoder, fixes #34 remove newline --- assert.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assert.go b/assert.go index b6fd10d..73cd898 100644 --- a/assert.go +++ b/assert.go @@ -43,7 +43,7 @@ func AssertHTTPResponse(t *testing.T, id string, w *http.Response) { // If the response body is JSON, indent. if contentTypeIsJSON(contentType) { - lines := strings.Split(data, "\n") + lines := strings.Split(strings.TrimSpace(data), "\n") jsonStr := lines[len(lines)-1] var jsonIface map[string]interface{}