IDNA normalization is only performed in NormalizeURLString, but that function returns a string. If you need a url.URL, you must then parse the result of NormalizeURLString, which means you are parsing the URL yet again, which is wasteful.
As NormalizeURLString calls NormalizeURL, the IDNA normalization in the former should be moved to the later, resulting in the URL passed to NormalizeURL having its host field IDNA normalized.
IDNA normalization is only performed in
NormalizeURLString, but that function returns astring. If you need aurl.URL, you must then parse the result ofNormalizeURLString, which means you are parsing the URL yet again, which is wasteful.As
NormalizeURLStringcallsNormalizeURL, the IDNA normalization in the former should be moved to the later, resulting in theURLpassed toNormalizeURLhaving its host field IDNA normalized.