forked from mirror/gin
render: update msgpack usage (#1498)
please see msgpack usage: https://github.com/ugorji/go/tree/master/codec#usage
This commit is contained in:
parent
6073a79ee0
commit
32b58e0fd2
|
@ -26,6 +26,6 @@ func (r MsgPack) Render(w http.ResponseWriter) error {
|
|||
|
||||
func WriteMsgPack(w http.ResponseWriter, obj interface{}) error {
|
||||
writeContentType(w, msgpackContentType)
|
||||
var h codec.Handle = new(codec.MsgpackHandle)
|
||||
return codec.NewEncoder(w, h).Encode(obj)
|
||||
var mh codec.MsgpackHandle
|
||||
return codec.NewEncoder(w, &mh).Encode(obj)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue