#!/usr/bin/env bash # Fail on unformatted Go files unformatted=$(gofmt -l . 2>/dev/null) if [ -n "$unformatted" ]; then echo "gofmt: these files are not formatted:" echo "$unformatted" exit 1 fi