Standard library / net/http

http.SameSiteLaxMode

Restrict many cross-site uses while allowing certain top-level navigations. Go cookiejar does not simulate browser SameSite policy. Expected stdout: '2\n'.

Formal Syntax & Structure

go syntaxgo
const SameSiteLaxMode SameSite = 2

Working Example

Example Snippetgo
package main
import (  "fmt"  "net/http")
func main() { fmt.Println(int(http.SameSiteLaxMode)) }
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)  }}
Go Reference