Logger only prints internal errors

This commit is contained in:
Manu Mtz-Almeida
2015-06-06 17:24:16 +02:00
parent 70325deb98
commit dde06a07f0
3 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -80,9 +80,9 @@ func (msg *Error) Error() string {
// ie ByType(gin.ErrorTypePublic) returns a slice of errors with type=ErrorTypePublic
func (a errorMsgs) ByType(typ ErrorType) errorMsgs {
if len(a) == 0 {
return a
return nil
}
result := make(errorMsgs, 0, len(a))
var result errorMsgs = nil
for _, msg := range a {
if msg.Type&typ > 0 {
result = append(result, msg)