forked from parnurzeal/gorequest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (24 loc) · 716 Bytes
/
Makefile
File metadata and controls
28 lines (24 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
GO ?= go
GOFMT ?= gofmt "-s"
GO_VERSION=$(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
PACKAGES ?= $(shell $(GO) list ./...)
VETPACKAGES ?= $(shell $(GO) list ./... | grep -v /examples/)
GOFILES := $(shell find . -name "*.go")
.PHONY: init
init:
@if [ $(GO_VERSION) -gt 15 ]; then \
$(GO) install github.com/golangci/golangci-lint/cmd/[email protected]; \
elif [ $(GO_VERSION) -lt 16 ]; then \
$(GO) get -u github.com/golangci/golangci-lint/cmd/[email protected]; \
fi
.PHONY: dep
dep:
$(GO) mod tidy
$(GO) mod vendor
.PHONY: lint
lint:
export GOFLAGS=-mod=vendor
golangci-lint run
.PHONY: test
test:
$(GO) test -mod=vendor . -covermode=count -coverprofile .coverage.cov