-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* main: toolexec rewrite expected * p1: no import, no rewrite * p2: already wrapped * p3: toolexec rewrite expected
- Loading branch information
Showing
4 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package p2 | ||
|
||
import ( | ||
"errors" | ||
|
||
"braces.dev/errtrace" | ||
|
||
"braces.dev/errtrace/cmd/errtrace/testdata/toolexec-test/p3" | ||
) | ||
|
||
// ReturnErr returns an error. | ||
func ReturnErr() error { | ||
return errtrace.Wrap(errors.New("test")) // @trace | ||
// CallP3 calls p3, and wraps the error. | ||
func CallP3() error { | ||
return errtrace.Wrap(p3.ReturnErr()) // @trace | ||
} |
2 changes: 1 addition & 1 deletion
2
...ace/testdata/toolexec-test/p2/errtrace.go → ...ace/testdata/toolexec-test/p3/errtrace.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package p2 | ||
package p3 | ||
|
||
// Opt-in to errtrace wrapping with toolexec. | ||
import _ "braces.dev/errtrace" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package p3 | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
// ReturnErr returns an error. | ||
func ReturnErr() error { | ||
return errors.New("test") // @trace | ||
} |