aboutsummaryrefslogtreecommitdiffhomepage
path: root/model
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2017-11-27 21:30:04 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2017-11-27 21:40:05 -0800
commitbb8e61c7c5d9f297bde207c6de07a5d4b67dcd29 (patch)
tree1d907010e659bbcf65c32df8d10fd91de97a8703 /model
parent8781648af9f730d8bd1a7d9c395c1f28f9058716 (diff)
Make sure golint pass on the code base
Diffstat (limited to 'model')
-rw-r--r--model/theme.go6
-rw-r--r--model/user.go12
2 files changed, 5 insertions, 13 deletions
diff --git a/model/theme.go b/model/theme.go
index c9bbc05..85307ce 100644
--- a/model/theme.go
+++ b/model/theme.go
@@ -6,8 +6,8 @@ package model
import "github.com/miniflux/miniflux2/errors"
-// GetThemes returns the list of available themes.
-func GetThemes() map[string]string {
+// Themes returns the list of available themes.
+func Themes() map[string]string {
return map[string]string{
"default": "Default",
"black": "Black",
@@ -16,7 +16,7 @@ func GetThemes() map[string]string {
// ValidateTheme validates theme value.
func ValidateTheme(theme string) error {
- for key := range GetThemes() {
+ for key := range Themes() {
if key == theme {
return nil
}
diff --git a/model/user.go b/model/user.go
index b756f1b..c030d52 100644
--- a/model/user.go
+++ b/model/user.go
@@ -33,11 +33,7 @@ func (u User) ValidateUserCreation() error {
return err
}
- if err := u.ValidatePassword(); err != nil {
- return err
- }
-
- return nil
+ return u.ValidatePassword()
}
// ValidateUserModification validates user for modification.
@@ -54,11 +50,7 @@ func (u User) ValidateUserModification() error {
return err
}
- if err := ValidateTheme(u.Theme); err != nil {
- return err
- }
-
- return nil
+ return ValidateTheme(u.Theme)
}
// ValidateUserLogin validates user credential requirements.