1
0
mirror of https://github.com/golang/go synced 2024-11-21 11:44:43 -07:00

Wrong sense on this error

This commit is contained in:
Cassondra Foesch 2024-09-19 17:35:28 +00:00
parent 4bc6a36ae9
commit f7be4ea7d9

View File

@ -757,7 +757,7 @@ func (p *addrParser) consumeDomainLiteral() (string, error) {
return "", fmt.Errorf("mail: invalid IPv6 address in domain-literal: %q", dtext)
}
} else if net.ParseIP(dtext).To4() != nil {
} else if net.ParseIP(dtext).To4() == nil {
return "", fmt.Errorf("mail: invalid IP address in domain-literal: %q", dtext)
}