aboutsummaryrefslogtreecommitdiff
path: root/internal/form
diff options
context:
space:
mode:
Diffstat (limited to 'internal/form')
-rw-r--r--internal/form/form.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/form/form.go b/internal/form/form.go
index e2fe1a1f..db6e040b 100644
--- a/internal/form/form.go
+++ b/internal/form/form.go
@@ -57,7 +57,7 @@ func Assign(form interface{}, data map[string]interface{}) {
// Allow ignored fields in the struct
if fieldName == "-" {
continue
- } else if len(fieldName) == 0 {
+ } else if fieldName == "" {
fieldName = com.ToSnakeCase(field.Name)
}
@@ -119,7 +119,7 @@ func validate(errs binding.Errors, data map[string]interface{}, f Form, l macaro
data["Err_"+field.Name] = true
trName := field.Tag.Get("locale")
- if len(trName) == 0 {
+ if trName == "" {
trName = l.Tr("form." + field.Name)
} else {
trName = l.Tr(trName)