forked from yomorun/yomo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 716 Bytes
/
Makefile
File metadata and controls
29 lines (23 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
29
GO ?= go
GOFMT ?= gofmt "-s"
GOFILES := $(shell find . -name "*.go")
VETPACKAGES ?= $(shell $(GO) list ./... | grep -v /example/)
TAGS ?= $(shell git describe --tags 2>/dev/null || git rev-parse --short HEAD)
.PHONY: fmt
fmt:
$(GOFMT) -w $(GOFILES)
.PHONY: vet
vet:
$(GO) vet $(VETPACKAGES)
.PHONY: lint
lint:
revive -exclude example/... -exclude cli/... -exclude vendor/... -exclude TEST -formatter friendly ./...
.PHONY: build
build:
$(GO) build -race -tags "$(TAGS)" -o bin/yomo -trimpath -ldflags "-s -w" ./cmd/yomo/main.go
.PHONY: test
test:
$(GO) test -race -covermode=atomic $(VETPACKAGES)
.PHONY: coverage
coverage:
$(GO) test -v -race -coverprofile=coverage.txt -covermode=atomic $(VETPACKAGES)