Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
proposal: net/mail: special error for empty group address #28638
Empty group address is often used to hide email recipients, for example,
The mail.ParseAddress() function returns nil and error on such inputs now, and this error ("mail: empty group") is not exported. Hence it is difficult to parse a wide range of emails.
If you parse
with ParseAddress, then only the second case will succeed. ParseAddress means 1 address. So don't you want ParseAddressList anyway, which accepts both 0 and 2 addresses? And then you shouldn't need this error to be exported.