Adds comments

This commit is contained in:
Manu Mtz-Almeida
2015-07-02 18:42:33 +02:00
parent 4cc2de6207
commit a20984c2bc
3 changed files with 40 additions and 25 deletions

View File

@ -102,10 +102,10 @@ func (a errorMsgs) ByType(typ ErrorType) errorMsgs {
// Shortcut for errors[len(errors)-1]
func (a errorMsgs) Last() *Error {
length := len(a)
if length == 0 {
return nil
if length > 0 {
return a[length-1]
}
return a[length-1]
return nil
}
// Returns an array will all the error messages.