Standard library / net/http/cookiejar
cookiejar.Options
Controls the public suffix list used to reject overly broad cookie domains. Zero options are test-only; use maintained data for production. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
type Options struct { PublicSuffixList PublicSuffixList}Working Example
Example Snippetgo
package main
import ( "fmt" "net/http/cookiejar")
func main() { o := &cookiejar.Options{}; j := must(cookiejar.New(o)); fmt.Println(j != nil) }
func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}