Skip to content

Commit

Permalink
Add gofmt (goimports) Github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmaguire committed Jan 26, 2024
1 parent ff18edd commit 59f392e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/gofmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check code formatting
on: [push]

jobs:
goimports:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.21.x'

- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest

- name: Check goimports
run: if [ "$(goimports -l . | wc -l)" -gt 0 ]; then exit 1; fi

0 comments on commit 59f392e

Please sign in to comment.