update msgpack usage

This commit is contained in:
thinkerou 2018-08-19 18:16:55 +08:00
parent 6073a79ee0
commit ed4c8a54b6

View File

@ -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)
}