Skip to content

Add gofmt (goimports) Github workflow #2

Add gofmt (goimports) Github workflow

Add gofmt (goimports) Github workflow #2

Workflow file for this run

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