Skip to content

Commit 4bc6a36

Browse files
committed
move comment to more rational position
1 parent dfa5f64 commit 4bc6a36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net/mail/message.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,13 +751,13 @@ func (p *addrParser) consumeDomainLiteral() (string, error) {
751751
return "", errors.New("mail: unclosed domain-literal")
752752
}
753753

754+
// Check if the domain literal is an IP address
754755
if addr, ok := strings.CutPrefix(dtext, "IPv6:"); ok {
755756
if len(net.ParseIP(addr)) != net.IPv6len {
756757
return "", fmt.Errorf("mail: invalid IPv6 address in domain-literal: %q", dtext)
757758
}
758759

759760
} else if net.ParseIP(dtext).To4() != nil {
760-
// Check if the domain literal is an IP address
761761
return "", fmt.Errorf("mail: invalid IP address in domain-literal: %q", dtext)
762762
}
763763

0 commit comments

Comments
 (0)