update comment (#1057)

This commit is contained in:
田欧
2017-08-16 11:55:50 +08:00
committed by Bo-Yi Wu
parent ecae34c4e1
commit a8fa424ae5
13 changed files with 48 additions and 49 deletions

View File

@ -65,7 +65,7 @@ func (msg *Error) JSON() interface{} {
return json
}
// MarshalJSON implements the json.Marshaller interface
// MarshalJSON implements the json.Marshaller interface.
func (msg *Error) MarshalJSON() ([]byte, error) {
return json.Marshal(msg.JSON())
}
@ -80,7 +80,7 @@ func (msg *Error) IsType(flags ErrorType) bool {
}
// ByType returns a readonly copy filtered the byte.
// ie ByType(gin.ErrorTypePublic) returns a slice of errors with type=ErrorTypePublic
// ie ByType(gin.ErrorTypePublic) returns a slice of errors with type=ErrorTypePublic.
func (a errorMsgs) ByType(typ ErrorType) errorMsgs {
if len(a) == 0 {
return nil
@ -98,7 +98,7 @@ func (a errorMsgs) ByType(typ ErrorType) errorMsgs {
}
// Last returns the last error in the slice. It returns nil if the array is empty.
// Shortcut for errors[len(errors)-1]
// Shortcut for errors[len(errors)-1].
func (a errorMsgs) Last() *Error {
if length := len(a); length > 0 {
return a[length-1]