diff options
author | 2017-11-27 21:30:04 -0800 | |
---|---|---|
committer | 2017-11-27 21:40:05 -0800 | |
commit | bb8e61c7c5d9f297bde207c6de07a5d4b67dcd29 (patch) | |
tree | 1d907010e659bbcf65c32df8d10fd91de97a8703 /server/ui/form/auth.go | |
parent | 8781648af9f730d8bd1a7d9c395c1f28f9058716 (diff) |
Make sure golint pass on the code base
Diffstat (limited to 'server/ui/form/auth.go')
-rw-r--r-- | server/ui/form/auth.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server/ui/form/auth.go b/server/ui/form/auth.go index 3cfc217..6849339 100644 --- a/server/ui/form/auth.go +++ b/server/ui/form/auth.go @@ -5,23 +5,27 @@ package form import ( - "errors" "net/http" + + "github.com/miniflux/miniflux2/errors" ) +// AuthForm represents the authentication form. type AuthForm struct { Username string Password string } +// Validate makes sure the form values are valid. func (a AuthForm) Validate() error { if a.Username == "" || a.Password == "" { - return errors.New("All fields are mandatory.") + return errors.NewLocalizedError("All fields are mandatory.") } return nil } +// NewAuthForm returns a new AuthForm. func NewAuthForm(r *http.Request) *AuthForm { return &AuthForm{ Username: r.FormValue("username"), |