-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 946 Bytes
/
Makefile
File metadata and controls
39 lines (29 loc) · 946 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
# === CONFIG 8< ================================================================
#
#
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
NO_COLOR=\033[0m
# === CONSTANTS =============================================================
BUILD_DIR ?= build
APP_BINARY_SRC=cmd/main.go
app_name=synmail-api
.PHONY: build
build:
@printf "$(OK_COLOR)==> Building synmail-api binaries $(NO_COLOR)\n"
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BUILD_DIR}/${app_name} ${APP_BINARY_SRC}
.PHONY: test
test:
@printf "$(OK_COLOR)==> Running Test $(NO_COLOR)\n"
mkdir -p "${BUILD_DIR}"
go test -v -race ./...
.PHONY: lint
lint:
@printf "$(OK_COLOR)==> Running Linter following https://github.com/golang/go/wiki/CodeReviewComments $(NO_COLOR)\n"
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.1
golangci-lint run --timeout=2m ./...
.PHONY: fmt
fmt:
go install mvdan.cc/gofumpt@latest
gofumpt -w .