I don't know if it's intentional, but I think it's expected. The panic happens because it tries to stringify the underlying error, which is nil. I would say the creation of a packages error types are the purview of that package. I don't think you can, generally, expect that their zero values are valid.
On Sun, Sep 19, 2021 at 1:29 PM Brian Candler <b.cand...@pobox.com> wrote: > Is this intentional? > https://play.golang.org/p/ylXlkOq2sID > > Result I get in browser: > > &{0} > %!v(PANIC=Error method: runtime error: invalid memory address or nil > pointer dereference) > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/73b364e9-bb46-4ec6-9d3d-42e7b04772f5n%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/73b364e9-bb46-4ec6-9d3d-42e7b04772f5n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAEkBMfH_M83e190bTi8-3HZTTLjnEr0c2UOiRDAW_aF5gM7QuA%40mail.gmail.com.