github.com/graywolf-at-work-2/terraform-vendor@v1.4.5/scripts/gofmtcheck.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # Check go fmt
     4  echo "==> Checking that code complies with go fmt requirements..."
     5  gofmt_files=$(go fmt ./...)
     6  if [[ -n ${gofmt_files} ]]; then
     7      echo 'gofmt needs running on the following files:'
     8      echo "${gofmt_files}"
     9      echo "You can use the command: \`go fmt\` to reformat code."
    10      exit 1
    11  fi
    12  
    13  exit 0