Skip to content
Myr

We do not longer have to call JSON() explicitly

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

authored by Manu Mtz-Almeida · committed by Manu Mtz-Almeida · parent 352868e · Browse files · 1 file+4 added−4 removed
This commit

State

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

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:logger.go+4 added-4 removed
26 unmodified lines
2728func ErrorLoggerT(typ ErrorType) HandlerFunc {29 return func(c *Context) {30 c.Next()3131 // avoid writting if we already wrote into the response body32 if !c.Writer.Written() {33 json := c.Errors.ByType(typ).JSON()34 if json != nil {35 c.JSON(-1, json)33 errors := c.Errors.ByType(typ)34 if len(errors) > 0 {35 c.JSON(-1, errors)36 }37 }38 }39}
74 unmodified lines