We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Formatting CI

Now that we understand how to check for formatting issues, let's add a formatting check to the CI workflow.

Check for Formatting Issues

test -z $(go fmt ./...)

Assignment

We could simply add it as another step within the same "tests" job, but I think it will be cool to run independent CI checks in parallel.

After all, tests and formatting aren't dependent on each other, so why not run them in parallel and save some time? However, we will need to duplicate the "set up Go" and "check out code" steps in the new job because they are not shared between jobs.

Paste the URL of your GitHub repo into the box and run the GitHub checks.

Tips

If you have an open pull request and push new commits to the head branch (the one with the new changes) GitHub will automatically update the PR and rerun the actions.