Skip to content

Commit 04749bc

Browse files
committed
Fix golangci-lint issues
1 parent fc1b288 commit 04749bc

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

baked_in.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,11 +2123,8 @@ func isDatetime(fl FieldLevel) bool {
21232123

21242124
if field.Kind() == reflect.String {
21252125
_, err := time.Parse(param, field.String())
2126-
if err != nil {
2127-
return false
2128-
}
21292126

2130-
return true
2127+
return err == nil
21312128
}
21322129

21332130
panic(fmt.Sprintf("Bad field type %T", field.Interface()))

validator_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9375,7 +9375,7 @@ func TestUniqueValidationStructSlice(t *testing.T) {
93759375
}
93769376
}
93779377
}
9378-
PanicMatches(t, func() { validate.Var(testStructs, "unique=C") }, "Bad field name C")
9378+
PanicMatches(t, func() { _ = validate.Var(testStructs, "unique=C") }, "Bad field name C")
93799379
}
93809380

93819381
func TestHTMLValidation(t *testing.T) {
@@ -10143,7 +10143,7 @@ func TestGetTag(t *testing.T) {
1014310143
}
1014410144

1014510145
val := New()
10146-
val.RegisterValidation("mytag", func(fl FieldLevel) bool {
10146+
_ = val.RegisterValidation("mytag", func(fl FieldLevel) bool {
1014710147
tag = fl.GetTag()
1014810148
return true
1014910149
})

0 commit comments

Comments
 (0)