Skip to content

Commit 1d9a9fe

Browse files
committed
docs: Mention the -trimpath recommendation in the README
1 parent c5e7320 commit 1d9a9fe

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,14 @@ At a high level:
2727
1. Record the _structured_ metadata alongside the error message.
2828

2929
For more details, see [the official docs](https://pkg.go.dev/github.com/kinbiko/rogerr).
30+
31+
### Build Recommendations
32+
33+
For cleaner stacktrace file paths, build with the `-trimpath` flag:
34+
35+
```bash
36+
go build -trimpath ./cmd/myapp
37+
```
38+
39+
This removes local build path prefixes, showing module-relative paths instead of absolute machine-specific paths.
40+
Not needed if stacktraces are disabled with `WithStacktrace(false)`, e.g. for performance reasons.

0 commit comments

Comments
 (0)