Don't pretty-print by default. Saves an allocation (or more) and a copy.

This commit is contained in:
Brendan Burns
2015-06-08 16:33:58 -07:00
parent b68e08f55f
commit b68ddbaf75
8 changed files with 2603 additions and 19 deletions

View File

@@ -2239,7 +2239,7 @@ func (*UnregisteredAPIObject) IsAnAPIObject() {}
func TestWriteJSONDecodeError(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
writeJSON(http.StatusOK, codec, &UnregisteredAPIObject{"Undecodable"}, w)
writeJSON(http.StatusOK, codec, &UnregisteredAPIObject{"Undecodable"}, w, false)
}))
defer server.Close()
status := expectApiStatus(t, "GET", server.URL, nil, http.StatusInternalServerError)