Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on (On | No) Syntactic Support for Error Handling. Parent comment
You can put that in-band, with something like:
v := funcWithError()? err := { return fmt.Errorf("lazy programmer wrapping: %w", err) }
Or you can do some kind of magic to allow it to happen out of band:
// found somewhere else in the codebase func wrapErr(err error) error { if err == nil { return nil } return fmt.Errorf("lazy programmer wrapping: %w", err) } v := funcWithError()?(wrapErr)
There are no comments on this comment yet.
You can put that in-band, with something like:
But in that case what have you really gained?Or you can do some kind of magic to allow it to happen out of band:
But that's where you start to see things hidden.