Standard library / crypto/x509
crypto/x509.SystemRootsError.Unwrap()
Exposes the underlying system-root error for errors.Is and errors.As. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (se SystemRootsError) Unwrap() errorReturn Value
error
Result as described above; check any returned error before use.
Working Example
Example Snippetgo
package main
import ( "crypto/x509" "errors" "fmt")
func main() { cause := errors.New("synthetic") e := x509.SystemRootsError{Err: cause} fmt.Println(errors.Is(e, cause))}
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) }}