mirror of
https://github.com/mjl-/mox.git
synced 2024-12-28 01:13:47 +03:00
19 lines
382 B
Go
19 lines
382 B
Go
|
package publicsuffix_test
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"fmt"
|
||
|
|
||
|
"golang.org/x/exp/slog"
|
||
|
|
||
|
"github.com/mjl-/mox/dns"
|
||
|
"github.com/mjl-/mox/publicsuffix"
|
||
|
)
|
||
|
|
||
|
func ExampleLookup() {
|
||
|
// Lookup the organizational domain for sub.example.org.
|
||
|
orgDom := publicsuffix.Lookup(context.Background(), slog.Default(), dns.Domain{ASCII: "sub.example.org"})
|
||
|
fmt.Println(orgDom)
|
||
|
// Output: example.org
|
||
|
}
|