I am dealing with golang and CI (namely CircleCI) recently. There are lots of tricks to speed up the build / test in CI and this is a short post about go fmt.
This CircleCI blog post suggests the use of this:
! go fmt ./... 2>&1 | read However, I find this unreliable as it works locally but exits with return code >128 for read on CircleCI. According to the man page, it indicates some kind of a timeout.