gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source
https://gno.land/
Other
875 stars 355 forks source link

Support `errors.Is` and `errors.As` in the standard gno `errors` package #486

Open zivkovicmilos opened 1 year ago

zivkovicmilos commented 1 year ago

Description

Currently, the only way to compare errors in .gno packages is to use the equals operator ==, as users are limited to the standard errors package.

Gno should support other useful methods from the Go standard errors library, like errors.Is and errors.As, because it makes it easy to do error comparisons and brings it closer to idiomatic Go.

moul commented 1 year ago

Related to https://github.com/gnolang/gno/issues/239

moul commented 1 year ago

Btw, you don't need to wait for #239 to be done to just port those missing helpers. Feel free to open a PR.