internal: fix issues found by shellcheck (#177)
This commit is contained in:
@@ -43,7 +43,8 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Ensuring .go files are formatted with gofmt -s..."
|
echo "Ensuring .go files are formatted with gofmt -s..."
|
||||||
DIFF=$(gofmt -s -d `find . -name '*.go' -type f | grep -v testdata`)
|
mapfile -t go_files < <(find . -name '*.go' -type f | grep -v testdata)
|
||||||
|
DIFF="$(gofmt -s -d "${go_files[@]}")"
|
||||||
if [ -n "$DIFF" ]; then
|
if [ -n "$DIFF" ]; then
|
||||||
echo "FAIL: please run gofmt -s and commit the result"
|
echo "FAIL: please run gofmt -s and commit the result"
|
||||||
echo "$DIFF";
|
echo "$DIFF";
|
||||||
@@ -61,7 +62,7 @@ fi;
|
|||||||
if [[ $(go version) == *go1\.12* ]]; then
|
if [[ $(go version) == *go1\.12* ]]; then
|
||||||
echo
|
echo
|
||||||
echo "Ensuring that there are no dependencies not listed in ./internal/alldeps..."
|
echo "Ensuring that there are no dependencies not listed in ./internal/alldeps..."
|
||||||
./internal/listdeps.sh | diff ./internal/alldeps - && echo "OK" || {
|
(./internal/listdeps.sh | diff ./internal/alldeps - && echo "OK") || {
|
||||||
echo "FAIL: dependencies changed; run: internal/listdeps.sh > internal/alldeps"
|
echo "FAIL: dependencies changed; run: internal/listdeps.sh > internal/alldeps"
|
||||||
# Module behavior may differ across versions.
|
# Module behavior may differ across versions.
|
||||||
echo "using go version 1.12."
|
echo "using go version 1.12."
|
||||||
|
|||||||
Reference in New Issue
Block a user