We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8174b29 commit 83cacc5Copy full SHA for 83cacc5
Makefile
@@ -96,3 +96,16 @@ test-coverage:
96
.PHONY: test-build
97
test-build:
98
bats -r ./test
99
+
100
+.PHONY: deadcode
101
+deadcode:
102
+ifeq (, $(shell command -v deadcode 2> /dev/null))
103
+ $(error "'deadcode' command not found. You can install it locally with 'go install golang.org/x/tools/cmd/deadcode@latest'.")
104
+endif
105
+ @out=$$(deadcode -test ./... 2>/dev/null); \
106
+ if [ -n "$$out" ] && [ "$$out" != "null" ]; then \
107
+ echo "Dead code detected:" >&2; \
108
+ echo "$$out" >&2; \
109
+ exit 1; \
110
+ fi
111
+ @echo "No dead code found."
0 commit comments