Standard library / crypto/tls
tls.AlertError
Represents TLS alert code as an error, particularly useful for QUIC TLS alerts; this fixture constructs a synthetic alert. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
type AlertError uint8Working Example
Example Snippetgo
package main
import ( "crypto/tls" "fmt")
func main() { var e error = tls.AlertError(40); fmt.Println(e != 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) }}