Update cri to 4ea022f82a55c449bf15bfc62ac8b0de968d81be.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2019-09-23 17:51:26 -07:00
parent 51f8807d02
commit fc31fa176d
138 changed files with 38904 additions and 16530 deletions

View File

@@ -5,7 +5,6 @@ package restful
// that can be found in the LICENSE file.
import (
"encoding/json"
"encoding/xml"
"strings"
"sync"
@@ -128,7 +127,7 @@ type entityJSONAccess struct {
// Read unmarshalls the value from JSON
func (e entityJSONAccess) Read(req *Request, v interface{}) error {
decoder := json.NewDecoder(req.Request.Body)
decoder := NewDecoder(req.Request.Body)
decoder.UseNumber()
return decoder.Decode(v)
}
@@ -147,7 +146,7 @@ func writeJSON(resp *Response, status int, contentType string, v interface{}) er
}
if resp.prettyPrint {
// pretty output must be created and written explicitly
output, err := json.MarshalIndent(v, " ", " ")
output, err := MarshalIndent(v, "", " ")
if err != nil {
return err
}
@@ -159,5 +158,5 @@ func writeJSON(resp *Response, status int, contentType string, v interface{}) er
// not-so-pretty
resp.Header().Set(HEADER_ContentType, contentType)
resp.WriteHeader(status)
return json.NewEncoder(resp).Encode(v)
return NewEncoder(resp).Encode(v)
}