error.As reports a false positive as shown below. Add support for errors.As, and other similar functions in the trusted functions framework.
func retErr() error {
return nil
}
type myErr struct{}
func (myErr) Error() string { return "myErr message" }
func test() {
err := retErr()
var x *myErr
if errors.As(err, &x) {
print(*x) // error reported here
}
}
error.Asreports a false positive as shown below. Add support for errors.As, and other similar functions in the trusted functions framework.