Added
- Function
netutil.ValidateTLDLabelwhich validates label of a name as if it's a top-level domain. - Functions
netutil.ValidateHostnameandnetutil.ValidateHostnameLabel. - New error type
netutil.LabelErrorwhich is returned by label validation functions. - New
LabelKindtype alias of string and the set of constants describing different types of name labels.
Changed
- Function
netutil.ValidateDomainNamenow validates over less strict set of rules (according to the second section of RFC 3696). Consider replacing it withnetutil.ValidateHostnameeverywhere the LDH (letters, digits, hyphens) rule is desired. - All the name validation functions now treat last label a TLD (top-level domain), validating it correspondingly.
- Type
AddrKindis now a type alias for string.