Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## 0.4.0 - 2025-07-21

This release supports compile-time rewriting of source files via `toolexec`.
Build your package or binary with `go build -toolexec errtrace` and all packages
that import `errtrace` will be automatically instrumented with `errtrace`.

### Added

- Add `UnwrapFrame` function to extract a single frame from an error.
You can use this to implement your own trace formatting logic.
- Support extracting trace frames from custom errors.
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ go install braces.dev/errtrace/cmd/errtrace@latest
errtrace offers the following modes of usage:

* [Manual instrumentation](#manual-instrumentation)
* [Automatic instrumentation](#automatic-instrumentation)
* [Automatic instrumentation](#automatic-instrumentation) on [save](#automatic-instrumentation-on-save) or at [compile time](#automatic-compile-time-instrumentation).

### Manual instrumentation

Expand Down Expand Up @@ -344,10 +344,20 @@ errtrace -w example.com/path/to/package
errtrace -w ./...
```

#### Automatic instrumentation on save

errtrace can be set be setup as a custom formatter in your editor,
similar to gofmt or goimports.

#### Opting-out during automatic instrumentation
#### Automatic compile-time instrumentation

![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)

errtrace can rewrite files as part of compilation by passing a `-toolexec` flag.
Build your package or binary with `go build -toolexec=errtrace` and all packages
that import `errtrace` will be automatically instrumented.

### Opting-out during automatic instrumentation

If you're relying on automatic instrumentation
and want to ignore specific lines from being instrumented,
Expand Down
Loading