I think you've misunderstood the purpose of that package and the relevant
standards. An IPv4 address is syntactically a valid domain name and thus no
error occurs. The ToASCII conversion is a nop in this case since there are
no non-ASCII characters. An IPv6 address is not a syntactically valid
domain name so you'll get an error. There is nothing about the conversion
process that requires validating whether the TLD (the right-most "100" in
your example) is in fact a valid TLD.

On Sat, Nov 12, 2022 at 8:22 AM redder <justma...@gmail.com> wrote:

> https://go.dev/play/p/HdLLJz0uz2q
>
> idna.Registration.ToASCII("100.100.100.100") doesn't return an error.
> Surely an IPv4 address can never be registered as a domain name and so this
> should return an error? I just need confirmation: is this function working
> as expected or is this a bug?
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/792a7e4a-3335-40c2-8fe9-fca394d2f988n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/792a7e4a-3335-40c2-8fe9-fca394d2f988n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD8ye97zh6TPvW9j_Lme_Jx1UCYdeajM3hDQdqxv%3DE21EQ%40mail.gmail.com.

Reply via email to