From 820cc4d729fefb70611306d148f7f6fdd9eafc77 Mon Sep 17 00:00:00 2001 From: guanguans Date: Tue, 19 Jan 2021 17:08:30 +0800 Subject: [PATCH] Update Makefile --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Makefile b/Makefile index f1873ed..f207973 100644 --- a/Makefile +++ b/Makefile @@ -1 +1,19 @@ # note: call scripts from /scripts +GOCMD=GO111MODULE=on go + +linters-install: + @golangci-lint --version >/dev/null 2>&1 || { \ + echo "installing linting tools..."; \ + curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0; \ + } + +lint: linters-install + $(PWD)/bin/golangci-lint run + +test: + $(GOCMD) test -cover -race ./... + +bench: + $(GOCMD) test -bench=. -benchmem ./... + +.PHONY: test lint linters-install