From 9f9bbc077314144d09e8746ee097de1ebc537e17 Mon Sep 17 00:00:00 2001 From: Suzuki Shunsuke Date: Wed, 2 Dec 2020 21:04:53 +0900 Subject: [PATCH] ci: add gofmt's '-s' option --- GNUmakefile | 2 +- scripts/gofmtcheck.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index cb6632bc..2eb8e15c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -34,7 +34,7 @@ vet: fi fmt: - gofmt -w $(GOFMT_FILES) + gofmt -s -w $(GOFMT_FILES) fmtcheck: @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" diff --git a/scripts/gofmtcheck.sh b/scripts/gofmtcheck.sh index 1c055815..1fb21df2 100755 --- a/scripts/gofmtcheck.sh +++ b/scripts/gofmtcheck.sh @@ -2,7 +2,7 @@ # Check gofmt echo "==> Checking that code complies with gofmt requirements..." -gofmt_files=$(gofmt -l `find . -name '*.go' | grep -v vendor`) +gofmt_files=$(gofmt -s -l `find . -name '*.go' | grep -v vendor`) if [[ -n ${gofmt_files} ]]; then echo 'gofmt needs running on the following files:' echo "${gofmt_files}"