summaryrefslogtreecommitdiff
path: root/vendor/github.com/golang/mock/ci/check_go_fmt.sh
blob: ae4028ac2527304df343635f3c5fd20e7d40b0d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
# This script is used by the CI to check if the code is gofmt formatted.

set -euo pipefail

GOFMT_DIFF=$(IFS=$'\n'; gofmt -d $( find . -type f -name '*.go' ) )
if [[ -n "${GOFMT_DIFF}" ]]; then
    echo "${GOFMT_DIFF}"
    echo
    echo "The go source files aren't gofmt formatted."
    exit 1
fi