@ -1487,8 +1487,8 @@ func isHostname(fl FieldLevel) bool {
func isFQDN(fl FieldLevel) bool {
val := fl.Field().String()
if val[len(val)-1] == '.' && val[len(val)-2] != '.' {
val = strings.TrimRight(val, ".")
if val[len(val)-1] == '.' {
val = val[0 : len(val)-1]
}
return hostnameRegex.MatchString(val) &&
@ -7182,6 +7182,7 @@ func TestFQDNValidation(t *testing.T) {
{"example24.com.", true},
{"test.example24.com.", true},
{"test24.example24.com.", true},
{"test24.example24.com..", false},
{"example", false},
{"192.168.0.1", false},
{"email@example.com", false},