aboutsummaryrefslogtreecommitdiffstats
path: root/build/goimports.sh
diff options
context:
space:
mode:
authorthomasmodeneis <thomas.modeneis@gmail.com>2018-04-18 06:53:50 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-04-18 06:53:50 +0800
commitba1030b6b84f810c04a82221a1b1c0a3dbf499a8 (patch)
tree9c3450535acddfec3b1987e0a2e04fa9ca303e38 /build/goimports.sh
parent7605e63cb9dda7fc5bb619abf1eb1f74ac3f6cc1 (diff)
downloaddexon-ba1030b6b84f810c04a82221a1b1c0a3dbf499a8.tar.gz
dexon-ba1030b6b84f810c04a82221a1b1c0a3dbf499a8.tar.zst
dexon-ba1030b6b84f810c04a82221a1b1c0a3dbf499a8.zip
build: enable goimports and varcheck linters (#16446)
Diffstat (limited to 'build/goimports.sh')
-rwxr-xr-xbuild/goimports.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/build/goimports.sh b/build/goimports.sh
new file mode 100755
index 000000000..6d67ef1f0
--- /dev/null
+++ b/build/goimports.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+find_files() {
+ find . -not \( \
+ \( \
+ -wholename '.github' \
+ -o -wholename './build/_workspace' \
+ -o -wholename './build/bin' \
+ -o -wholename './crypto/bn256' \
+ -o -wholename '*/vendor/*' \
+ \) -prune \
+ \) -name '*.go'
+}
+
+GOFMT="gofmt -s -w";
+GOIMPORTS="goimports -w";
+find_files | xargs $GOFMT;
+find_files | xargs $GOIMPORTS; \ No newline at end of file