7 "github.com/mjl-/mox/dns"
10func ExampleParseDomain() {
12 basic, err := dns.ParseDomain("example.com")
14 log.Fatalf("parse domain: %v", err)
16 fmt.Printf("%s\n", basic)
18 // IDNA domain xn--74h.example.
19 smile, err := dns.ParseDomain("☺.example")
21 log.Fatalf("parse domain: %v", err)
23 fmt.Printf("%s\n", smile)
25 // ASCII only domain curl.se in surprisingly allowed spelling.
26 surprising, err := dns.ParseDomain("ℂᵤⓇℒ。𝐒🄴")
28 log.Fatalf("parse domain: %v", err)
30 fmt.Printf("%s\n", surprising)
34 // ☺.example/xn--74h.example