]> git.immae.eu Git - github/fretlink/terraform-provider-mailgun.git/blame - scripts/errcheck.sh
add shellcheck to the makeffile and .travis.yml and fix the scripts to have no error...
[github/fretlink/terraform-provider-mailgun.git] / scripts / errcheck.sh
CommitLineData
e17f219a
AG
1#!/usr/bin/env bash
2
3# Check gofmt
4echo "==> Checking for unchecked errors..."
5
065bf5d7 6if ! command -v errcheck > /dev/null; then
e17f219a
AG
7 echo "==> Installing errcheck..."
8 go get -u github.com/kisielk/errcheck
9fi
10
11err_files=$(errcheck -ignoretests \
12 -ignore 'github.com/hashicorp/terraform/helper/schema:Set' \
13 -ignore 'bytes:.*' \
14 -ignore 'io:Close|Write' \
065bf5d7 15 "$(go list ./...| grep -v /vendor/)")
e17f219a
AG
16
17if [[ -n ${err_files} ]]; then
18 echo 'Unchecked errors found in the following places:'
19 echo "${err_files}"
20 echo "Please handle returned errors. You can check directly with \`make errcheck\`"
21 exit 1
22fi
23
24exit 0