mirror of
https://github.com/golang/go
synced 2024-11-22 05:24:39 -07:00
move comment to more rational position
This commit is contained in:
parent
dfa5f640b0
commit
4bc6a36ae9
@ -751,13 +751,13 @@ func (p *addrParser) consumeDomainLiteral() (string, error) {
|
|||||||
return "", errors.New("mail: unclosed domain-literal")
|
return "", errors.New("mail: unclosed domain-literal")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the domain literal is an IP address
|
||||||
if addr, ok := strings.CutPrefix(dtext, "IPv6:"); ok {
|
if addr, ok := strings.CutPrefix(dtext, "IPv6:"); ok {
|
||||||
if len(net.ParseIP(addr)) != net.IPv6len {
|
if len(net.ParseIP(addr)) != net.IPv6len {
|
||||||
return "", fmt.Errorf("mail: invalid IPv6 address in domain-literal: %q", dtext)
|
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 {
|
||||||
// Check if the domain literal is an IP address
|
|
||||||
return "", fmt.Errorf("mail: invalid IP address in domain-literal: %q", dtext)
|
return "", fmt.Errorf("mail: invalid IP address in domain-literal: %q", dtext)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user