Skip to content
Myr

Simplify code (#2004)

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

- Use buf.String instead of converison - Remove redundant return

authored by Christian Muehlhaeuser · committed by thinkerou · parent 502c898 · Browse files · 2 files+1 added−2 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+1 added−2 removed

  • other:+1 added−2 removed

2 files+1 added−2 removed

modified:render/render_test.go+1 added-1 removed
43 unmodified lines
44 assert.NotNil(t, buf)45 err = codec.NewEncoder(buf, h).Encode(data)4647 assert.NoError(t, err)48 assert.Equal(t, w.Body.String(), string(buf.Bytes()))48 assert.Equal(t, w.Body.String(), buf.String())49 assert.Equal(t, "application/msgpack; charset=utf-8", w.Header().Get("Content-Type"))50}5152func TestRenderJSON(t *testing.T) {
448 unmodified lines
modified:gin.go-1 removed
435 unmodified lines
436 }437 return438 }439 c.writermem.WriteHeaderNow()440 return440}441442func redirectTrailingSlash(c *Context) {443 req := c.Request
35 unmodified lines