-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (22 loc) · 800 Bytes
/
Makefile
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
# Copyright 2021 The customerror Authors. All rights reserved.
# Use of this source code is governed by a MIT
# license that can be found in the LICENSE file.
HAS_GOLANGCI := $(shell command -v golangci-lint;)
HAS_GODOC := $(shell command -v godoc;)
lint:
ifndef HAS_GOLANGCI
$(error You must install github.com/golangci/golangci-lint)
endif
@golangci-lint run -v -c .golangci.yml && echo "Lint OK"
test:
@go test -timeout 30s -short -v -race -cover -coverprofile=coverage.out ./...
coverage:
@go tool cover -func=coverage.out
doc:
ifndef HAS_GODOC
$(error You must install godoc, run "go get golang.org/x/tools/cmd/godoc")
endif
@echo "Open localhost:6060/pkg/github.com/thalesfsp/customerror/ in your browser\n"
@godoc -http :6060
ci: lint test coverage
.PHONY: lint test coverage ci