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

This commit is contained in:
ziheng
2021-06-25 12:14:06 +08:00
committed by GitHub
parent 7834a03e84
commit f2bbdfe9f2
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -39,6 +39,6 @@ func TestRenderMsgPack(t *testing.T) {
err = codec.NewEncoder(buf, h).Encode(data)
assert.NoError(t, err)
assert.Equal(t, w.Body.String(), string(buf.Bytes()))
assert.Equal(t, w.Body.String(), buf.String())
assert.Equal(t, "application/msgpack; charset=utf-8", w.Header().Get("Content-Type"))
}