github.com/noironetworks/cilium-net@v1.6.12/contrib/scripts/check-fmt.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -e
     4  set -o pipefail
     5  
     6  diff="$(find . ! \( -path './contrib' -prune \) \
     7          ! \( -path './vendor' -prune \) \
     8          ! \( -path './.git' -prune \) \
     9          ! \( -path '*.validate.go' -prune \) \
    10          -type f -name '*.go' | grep -v "daemon/bindata.go" | \
    11          xargs gofmt -d -l -s )"
    12  
    13  if [ -n "$diff" ]; then
    14  	echo "Unformatted Go source code:"
    15  	echo "$diff"
    16  	exit 1
    17  fi
    18  
    19  exit 0