-
Notifications
You must be signed in to change notification settings - Fork 136
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 785 Bytes
/
Makefile
File metadata and controls
39 lines (28 loc) · 785 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
32
33
34
35
36
37
38
39
REPOSITORY = $(shell go list -m)
GIT_COMMIT = $(shell git rev-parse --short HEAD)
BUILDFLAGS ?=
LDFLAGS = -ldflags="-X '${REPOSITORY}/cmd.GitCommit=${GIT_COMMIT}'"
unexport GOFLAGS
all: format mod build test
format: vet fmt mockgen docs
fmt:
@echo "gofmt"
@gofmt -w -s .
@git diff --exit-code .
build:
go build ${BUILDFLAGS} ${LDFLAGS} -o ./bin/osdctl main.go
vet:
go vet ${BUILDFLAGS} ./...
mod:
go mod tidy
@git diff --exit-code -- go.mod
docs: build
./bin/osdctl docs ./docs/command
@git diff --exit-code -- ./docs/command/
mockgen: ensure-mockgen
go generate ${BUILDFLAGS} ./...
@git diff --exit-code -- ./pkg/provider/aws/mock
ensure-mockgen:
go get github.com/golang/mock/mockgen@v1.4.4
test:
go test ${BUILDFLAGS} ./... -covermode=atomic -coverpkg=./...