Standard library / go/types
go/types.ArgumentError.Unwrap()
Returns the underlying error for error-chain inspection. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (e *ArgumentError) Unwrap() errorReturn Value
error
Parsing or setting error; nil on success.
Working Example
Example Snippetgo
package main
import ( "errors" "fmt" "go/types")
func main() { e := errors.New("bad") fmt.Println(errors.Is(&types.ArgumentError{Index: 0, Err: e}, e))}