Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a new errtrace binary that instruments existing Go code with errtrace.Wrap calls. This operates by searching for functions that return errors, and inside those functions, wrapping all returns with `errtrace.Wrap`. To allow for future usage with -toolexec or similar, the code edits all ensure that line numbers do not change. We may want to reconsider this behavior in the future. This works pretty well for the cases we tried it on except multi-return functions made by automatic expansion: func foo() (int, error) { return bar() } To support that, we'll need a generic `Wrap2[int]` function. That'll be added in a future change separately.
- Loading branch information