mox/publicsuffix/examples_test.go

18 lines
368 B
Go
Raw Normal View History

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
}