Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
don't require go.sum in go-check workflow
Browse files Browse the repository at this point in the history
If go.mod doesn't contain any dependencies, it's not necessary to have a go.sum
file.
  • Loading branch information
marten-seemann committed Apr 22, 2021
1 parent bdd2baa commit ee346bd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions templates/.github/workflows/go-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ jobs:
run: go install honnef.co/go/tools/cmd/staticcheck@be534f007836a777104a15f2456cd1fffd3ddee8 # v2020.2.2
- name: Check that go.mod is tidy
run: |
cp go.mod go.mod.orig
cp go.sum go.sum.orig
go mod tidy
diff go.mod go.mod.orig
diff go.sum go.sum.orig
if [[ -n $(git ls-files --other --exclude-standard --directory -- go.sum) ]]; then
echo "go.sum was added by go mod tidy"
exit 1
fi
git diff --exit-code -- go.sum go.mod
- name: gofmt
if: ${{ success() || failure() }} # run this step even if the previous one failed
run: |
Expand Down

0 comments on commit ee346bd

Please sign in to comment.