We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d09605 commit f16354eCopy full SHA for f16354e
baked_in.go
@@ -1494,6 +1494,10 @@ func isHostname(fl FieldLevel) bool {
1494
func isFQDN(fl FieldLevel) bool {
1495
val := fl.Field().String()
1496
1497
+ if val == "" {
1498
+ return false
1499
+ }
1500
+
1501
if val[len(val)-1] == '.' {
1502
val = val[0 : len(val)-1]
1503
}
validator_test.go
@@ -7189,6 +7189,7 @@ func TestFQDNValidation(t *testing.T) {
7189
{"2001:cdba:0000:0000:0000:0000:3257:9652", false},
7190
{"2001:cdba:0:0:0:0:3257:9652", false},
7191
{"2001:cdba::3257:9652", false},
7192
+ {"", false},
7193
7194
7195
validate := New()
0 commit comments