Skip to content
Myr

Use buf.String() instead of string(buf.Bytes()) (#2764)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ziheng · committed by GitHub · parent 7834a03 · Browse files · 2 files+3 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−1 removed

  • other:+3 added−1 removed

2 files+3 added−1 removed

modified:render/msgpack.go+2 added
11 unmodified lines
1213 "github.com/ugorji/go/codec"14)1516// Check interface implemented here to support go build tag nomsgpack.17// See: https://github.com/gin-gonic/gin/pull/1852/18var (19 _ Render = MsgPack{}20)21
23 unmodified lines
modified:render/render_msgpack_test.go+1 added-1 removed
37 unmodified lines
38 assert.NotNil(t, buf)39 err = codec.NewEncoder(buf, h).Encode(data)4041 assert.NoError(t, err)42 assert.Equal(t, w.Body.String(), string(buf.Bytes()))42 assert.Equal(t, w.Body.String(), buf.String())43 assert.Equal(t, "application/msgpack; charset=utf-8", w.Header().Get("Content-Type"))44}