diff --git a/.github/workflows/gofmt.yml b/.github/workflows/gofmt.yml new file mode 100644 index 0000000..65058d1 --- /dev/null +++ b/.github/workflows/gofmt.yml @@ -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