You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type
It seems that the second parameter is a non-nil pointer and hence should compile or the error message be improved. I understand that I can use and error variable of the specific type but since the actual typed error is not needed it would be nice if the anonymous new could be used here.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Check for error return type using
errors.As(err, new(Err))
: https://play.golang.com/p/nlxAmD6LtLmWhat did you expect to see?
Successful compile
What did you see instead?
It seems that the second parameter is a non-nil pointer and hence should compile or the error message be improved. I understand that I can use and error variable of the specific type but since the actual typed error is not needed it would be nice if the anonymous
new
could be used here.The text was updated successfully, but these errors were encountered: