mirror of
https://github.com/miniflux/v2.git
synced 2025-08-06 17:41:00 +00:00
Make sure golint pass on the code base
This commit is contained in:
parent
8781648af9
commit
bb8e61c7c5
59 changed files with 322 additions and 171 deletions
|
@ -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"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue