Skip to content

Commit f372403

Browse files
authored
ci: add deadcode check (#3)
* ci: add deadcode check * ci: enforce deadcode gate
1 parent df804b6 commit f372403

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,23 @@ jobs:
3737
go install honnef.co/go/tools/cmd/staticcheck@v0.7.0
3838
go install mvdan.cc/gofumpt@v0.9.2
3939
go install github.com/securego/gosec/v2/cmd/gosec@v2.26.1
40+
go install golang.org/x/tools/cmd/deadcode@v0.45.0
4041
4142
- name: Vet
4243
run: go vet ./...
4344

4445
- name: Staticcheck
4546
run: '"$(go env GOPATH)/bin/staticcheck" ./...'
4647

48+
- name: Deadcode
49+
run: |
50+
output_file=$(mktemp)
51+
"$(go env GOPATH)/bin/deadcode" -test ./... > "$output_file"
52+
if [ -s "$output_file" ]; then
53+
cat "$output_file"
54+
exit 1
55+
fi
56+
4757
- name: Gofumpt
4858
run: |
4959
changed="$("$(go env GOPATH)/bin/gofumpt" -l .)"

0 commit comments

Comments
 (0)