About this project
go-whatchanged is a command-line tool for inspecting what changed in the public API of a Go module between two versions. It compares a base and head side, where each side can be a working tree, a local checkout, a git revision, a branch, a tag, or a published module version such as github.com/x/m@v1.2.0. The default happy path is designed to be read-only: it avoids temporary directories, git clones, worktrees, and repository writes, using only go commands when remote packages are not already cached. A --fsreadonly flag disables even the module-cache download path for fully non-writing operation.
The tool reports added, removed, and changed exported symbols per package, and summarizes compatible versus incompatible changes. It also suggests the required semantic version bump, such as MAJOR, MINOR, or PATCH, and can enforce compatibility gates using exit codes via --exit-fail=major, minor, or patch. Filters allow narrowing output to breaking changes, public packages, internal packages, main packages, import changes, go.mod changes, or test changes. Package include and exclude patterns are supported for large modules and monorepos.
For integration into workflows, go-whatchanged supports text, Markdown, and JSON output formats. Markdown output is intended for pull request comments and job summaries, while JSON output is intended for scripts and bots. A GitHub Action is provided to post API diffs as pull request comments and job summaries. The README documents limitations including one platform per run, no go.work/vendor/GOPATH support, inability to diff modules declaring go 1.16 or older, and comparison of only the main module rather than dependencies.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.