Fix golangci-lint issues

pull/642/head
Elias Rodrigues 4 years ago
parent fc1b28803a
commit 04749bc4d4
  1. 5
      baked_in.go
  2. 4
      validator_test.go

@ -2123,11 +2123,8 @@ func isDatetime(fl FieldLevel) bool {
if field.Kind() == reflect.String { if field.Kind() == reflect.String {
_, err := time.Parse(param, field.String()) _, err := time.Parse(param, field.String())
if err != nil {
return false
}
return true return err == nil
} }
panic(fmt.Sprintf("Bad field type %T", field.Interface())) panic(fmt.Sprintf("Bad field type %T", field.Interface()))

@ -9375,7 +9375,7 @@ func TestUniqueValidationStructSlice(t *testing.T) {
} }
} }
} }
PanicMatches(t, func() { validate.Var(testStructs, "unique=C") }, "Bad field name C") PanicMatches(t, func() { _ = validate.Var(testStructs, "unique=C") }, "Bad field name C")
} }
func TestHTMLValidation(t *testing.T) { func TestHTMLValidation(t *testing.T) {
@ -10143,7 +10143,7 @@ func TestGetTag(t *testing.T) {
} }
val := New() val := New()
val.RegisterValidation("mytag", func(fl FieldLevel) bool { _ = val.RegisterValidation("mytag", func(fl FieldLevel) bool {
tag = fl.GetTag() tag = fl.GetTag()
return true return true
}) })

Loading…
Cancel
Save