Some don't like the magic, and some are worried about losing annotated errors. If you can tolerate just a little bit more magic, you can solve the error annotation problem:
f := try(os.Open(filename), "opening config file")
Place the context string just after the last, error parameter. That is, make try also also allow the pattern: try( a1, a2, ..., error, string ). Bonus points if the last arg could be a func(error) error, that way you can pass a local closure to wrap the error in a scoped context and also avoid pre-calculating an expensive error string even in the non-error case.It's just a language feature, you can make up any interface you want. We're already on the magic train, might as well ride it.