Skip to content

Commit

Permalink
Add staticcheck and go-generate Github check (#968)
Browse files Browse the repository at this point in the history
* Fix Staticcheck errors & minor logic simplification

Simplify logic in ui.go. In that diff, `st` would already have the
Reversed flag set; there's no need to set it again.

Also, minor changes to remove all the statickcheck errors VS code's
Go extension complains about.

* Add staticcheck and Go 1.19 go-generate Github check

This adds a few Github action checks:

1. Check that `go fmt` and `go generate` were run on Go 1.19, following
up on 654b873.
On earlier Go versions, `go generate` results in whitespace changes.

2. Check that [Staticcheck](https://staticcheck.io/) passes.
  • Loading branch information
ilyagr authored Oct 16, 2022
1 parent 04d4083 commit 624992a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Set up Go
uses: actions/setup-go@v2
Expand All @@ -26,3 +28,24 @@ jobs:

- name: Test
run: go test -v ./...

- uses: dominikh/[email protected]
with:
version: "2022.1.3"
install-go: false

generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19

- name: Test `go fmt && go generate` on Go 1.19 creates no diffs
run: go fmt && go generate && git diff --exit-code

0 comments on commit 624992a

Please sign in to comment.