Mercurial > gemma
diff pkg/models/gauge.go @ 1641:334d13e63342
Cosmetics.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 20 Dec 2018 13:19:54 +0100 |
parents | dd31be75ce6d |
children | a0982c38eac0 |
line wrap: on
line diff
--- a/pkg/models/gauge.go Thu Dec 20 12:50:37 2018 +0100 +++ b/pkg/models/gauge.go Thu Dec 20 13:19:54 2018 +0100 @@ -14,6 +14,7 @@ package models import ( + "errors" "fmt" "strconv" "time" @@ -43,7 +44,7 @@ // IsrsFromString converts string representation of isrs code to type Isrs func IsrsFromString(isrsCode string) (*Isrs, error) { if len(isrsCode) < 20 { - return nil, fmt.Errorf("to short") + return nil, errors.New("ISRS code too short") } hm, err := strconv.Atoi(isrsCode[15:20]) if err != nil { @@ -59,7 +60,7 @@ return &isrs, nil } -// ToString creates a isrs code string from Isrs +// String creates a isrs code string from Isrs func (isrs *Isrs) String() string { return fmt.Sprintf("%s%s%s%s%05d", isrs.CountryCode,