From 4d8adc8c879709acdd0c0b965d930750e2b54b8d Mon Sep 17 00:00:00 2001 From: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> Date: Thu, 20 Jan 2022 12:09:22 +0100 Subject: [PATCH] Add vet and staticcheck make targets --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile b/Makefile index f91b005..eb9cbd2 100644 --- a/Makefile +++ b/Makefile @@ -26,3 +26,14 @@ fmt: go fmt $(GOSRC_APP) find . -name "*.go" -exec go fmt {} \; +# Examine Go source code and reports suspicious constructs +.PHONY: vet + go vet ./... + + +# Run linter for the Go programming language. +# Using static analysis, it finds bugs and performance issues, offers simplifications, and enforces style rules +.PHONY: staticcheck +staticcheck: + go install honnef.co/go/tools/cmd/staticcheck@latest + $$(go env GOPATH)/bin/staticcheck ./...