From 332ca03f703b2b380aa1075e60e3cd1cad938a73 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 17 Sep 2023 17:18:51 +0700 Subject: Makefile: replace linter golangci-lint The golangci-lint become unusable. It does not provide any useful hints on how to write better Go code. This changes replace golangci-lint with go vet, fieldalignment and shadow from x/tools, and revive. The fieldalignment tool provide hints on better struct size. The shadow tool provide hints on overwriting or shadowed variables. The revive tool provide hints on many code analysis that does not covered by go vet, fieldalignment, and shadow. --- Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1d8720b..385779d 100644 --- a/Makefile +++ b/Makefile @@ -3,24 +3,31 @@ AWWAN_WORKSPACE:=_example -.PHONY: all build install test dev - +.PHONY: all all: test lint build +.PHONY: test test: CGO_ENABLED=1 go test -race -coverprofile=cover.out ./... go tool cover -html=cover.out -o cover.html +.PHONY: lint lint: - -golangci-lint run ./... + -go vet ./... + -fieldalignment ./... + -shadow ./... + -revive ./... +.PHONY: build build: mkdir -p _bin go run ./internal/cmd/awwan-internal build go build -o _bin/ ./cmd/awwan +.PHONY: install install: build go install ./cmd/awwan +.PHONY: dev dev: AWWAN_DEVELOPMENT=1 go run ./cmd/awwan serve $(AWWAN_WORKSPACE) -- cgit v1.3