-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (23 loc) · 921 Bytes
/
Makefile
File metadata and controls
31 lines (23 loc) · 921 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
30
31
.PHONY: help lint test race cover coverhtml
help:
@echo "Please use 'make <target>' where <target> is one of"
@echo " lint to run golint on files recursively"
@echo " test to run tests"
@echo " race to run tests with race detector"
@echo " cover to run tests with coverage"
@echo " coverhtml to run tests with coverage and generate html output"
lint:
golangci-lint -v run
build:
CGO_ENABLED=0 go build -ldflags "-extldflags '-static'" -tags netgo -o foxesscloud_exporter
build_linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-extldflags '-static'" -tags netgo -o foxesscloud_exporter
test:
@go test -v ./...
race:
@go test -race -v ./...
cover:
@go test -v -coverprofile=coverage.out -cover ./...
coverhtml:
@go test -v -coverprofile=coverage.out -cover ./...
@go tool cover -html=coverage.out