Skip to content

Commit

Permalink
Verify "go mod tidy" in CI
Browse files Browse the repository at this point in the history
Previously, there was no verification that it was possible to run
"go mod tidy" and "go mod vendor" in projects that depend on errors.
This commit adds a CI step to check that these "go mod" commands can
run successfully.
  • Loading branch information
kernfeld-cockroach committed Jul 29, 2021
1 parent fc43a0e commit 8931371
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ jobs:

- name: Test (${{ matrix.go }})
run: go test ./...

- name: Tidy (${{ matrix.go }})
run: '[[ `go version` < "go version go1.15.10" ]] || go mod tidy'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ older version of the package.

## How to use

This library works best with go ≥ 1.15.10. It works with 1.15.9 but breaks `go mod tidy` and `go mod vendor`.

- construct errors with `errors.New()`, etc as usual, but also see the other [error leaf constructors](#Available-error-leaves) below.
- wrap errors with `errors.Wrap()` as usual, but also see the [other wrappers](#Available-wrapper-constructors) below.
- test error identity with `errors.Is()` as usual.
Expand Down

0 comments on commit 8931371

Please sign in to comment.