mox/publicsuffix/examples_test.go
Mechiel Lukkien d1b87cdb0d
replace packages slog and slices from golang.org/x/exp with stdlib
since we are now at go1.21 as minimum.
2024-02-08 14:49:01 +01:00

17 lines
368 B
Go

package publicsuffix_test
import (
"context"
"fmt"
"log/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
}