From c5cc07900c67c2c8b565758dc4a66bc36b8cd7a9 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Fri, 6 Oct 2023 13:49:39 +0700 Subject: all: add task linter and fix all warnings We use revive [1], fieldalignment [2], and shadow [3] as linters. [1] https://github.com/mgechev/revive [2] https://pkg.go.dev/golang.org/x/tools@v0.13.0/go/analysis/passes/fieldalignment/cmd/fieldalignment [3] https://pkg.go.dev/golang.org/x/tools@v0.13.0/go/analysis/passes/shadow/cmd/shadow --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3cfbd13..25cbaba 100644 --- a/Makefile +++ b/Makefile @@ -3,12 +3,18 @@ .PHONY: all test build install serve-doc -all: test build +all: test lint build test: CGO_ENABLED=1 go test -race -failfast -coverprofile=cover.out ./... go tool cover -html=cover.out -o cover.html +.PHONY: lint +lint: + -revive ./... + -fieldalignment ./... + -shadow ./... + build: mkdir -p _sys/usr/bin/ go build -o _sys/usr/bin/ ./cmd/... -- cgit v1.3