Skip to content

Go Example

Repository: janitor-sh/go-example

Terminal window
go run .
Terminal window
janitor --no-commit

The example workflow runs on pushes and pull requests to main and uses go fmt directly:

- name: Run go fmt
run: go fmt ./...
- name: Commit and push formatting changes
run: |
git config user.name "janitor-sh[bot]"
git config user.email "janitor-sh[bot]@users.noreply.github.com"
if ! git diff --quiet -- .; then
git add -u
git commit -m "chore(janitor): apply automated lint/format fixes"
git push
fi