-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (30 loc) · 901 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
30
31
32
33
34
35
36
37
38
39
40
41
42
BIN_DIR = $(PWD)/bin
# Will setup linting tools
setup-linting:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.46.2
chmod +x ./bin/golangci-lint
lint-docker:
docker run --rm -i hadolint/hadolint < Dockerfile
# Download dependencies
install:
go mod download
# remove unused dependencies
tidy:
go mod tidy -v
# Runs project
run:
go run app/cmd/server/main.go
test:
go test ./...
test-coverage:
go test -tags testing -v -cover -covermode=atomic ./...
fmt: ## gofmt and goimports all go files
find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
clean:
if [ -f ${BIN_DIR} ] ; then rm ${BIN_DIR} ; fi
lint:
./bin/golangci-lint run ./...
build:
@echo "Building application"
go build -o $(BIN_DIR)/robinlb app/cmd/server/main.go
all: install lint test