An example is in the errors package: https://cs.opensource.google/go/go/+/refs/tags/go1.23.0:src/...
https://github.com/golang/go/blob/master/src/cmd/go/internal... https://github.com/golang/go/blob/master/src/io/fs/fs.go#L26... https://github.com/golang/go/blob/master/src/errors/wrap.go#... https://github.com/golang/go/blob/master/src/go/parser/resol...
If `ok' gets set to false, that seems optimal. Pretty neat, in fact, what other language permits such low-key, easy runtime interface checks?
v := hello.(world)
this never panic:
v, ok := hello.(world)
and yes, its awesome. people rag on Go because BLARG ERRORS BOILERPLATE, but if you can get over that Go is not Python/JavaScript, you're left with a simple powerful language