updating github.com/emicklei/go-restful to v2.9.5+incompatible

This commit is contained in:
Davanum Srinivas
2019-06-14 10:50:10 -04:00
parent 8d6848ada1
commit 453eac7c08
36 changed files with 514 additions and 211 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)
}