Skip to content

Run go mod tidy --diff in CI#80

Merged
nathanjcochran merged 1 commit intomainfrom
nathan/go-mod-tidy-ci
Oct 21, 2025
Merged

Run go mod tidy --diff in CI#80
nathanjcochran merged 1 commit intomainfrom
nathan/go-mod-tidy-ci

Conversation

@nathanjcochran
Copy link
Member

@nathanjcochran nathanjcochran commented Oct 21, 2025

Runs go mod tidy --diff in the CI pipeline, to ensure that the go.mod and go.sum files correctly reflects the modules needed by the source code (i.e. no missing modules and no extra unused modules). This is basically a way to make sure people run go mod tidy after adding/removing dependencies.

Per go help mod tidy:

The -diff flag causes tidy not to modify go.mod or go.sum but
instead print the necessary changes as a unified diff. It exits
with a non-zero code if the diff is not empty.

@nathanjcochran nathanjcochran self-assigned this Oct 21, 2025
Comment on lines +40 to +41
- name: ShellCheck
run: shellcheck scripts/install.sh
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this up from below because it's extremely fast, and better to give fast feedback on the install script than make people wait for all the tests to run.

@nathanjcochran nathanjcochran merged commit 81e47b4 into main Oct 21, 2025
2 checks passed
@nathanjcochran nathanjcochran deleted the nathan/go-mod-tidy-ci branch October 21, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants