...

Text file src/github.com/spf13/pflag/verify/gofmt.sh

Documentation: github.com/spf13/pflag/verify

     1#!/bin/bash
     2
     3set -o errexit
     4set -o nounset
     5set -o pipefail
     6
     7ROOT=$(dirname "${BASH_SOURCE}")/..
     8
     9pushd "${ROOT}" > /dev/null
    10
    11GOFMT=${GOFMT:-"gofmt"}
    12bad_files=$(find . -name '*.go' | xargs $GOFMT -s -l)
    13if [[ -n "${bad_files}" ]]; then
    14  echo "!!! '$GOFMT' needs to be run on the following files: "
    15  echo "${bad_files}"
    16  exit 1
    17fi
    18
    19# ex: ts=2 sw=2 et filetype=sh

View as plain text