-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
51 lines (41 loc) · 1.07 KB
/
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
43
44
45
46
47
48
49
50
51
# cross parameters
SHELL:=/bin/bash -O extglob
BINARY=patients-api
VERSION=0.1.0
LDFLAGS=-ldflags "-X main.Version=${VERSION}"
# Build step, generates the binary.
build:
go build ${LDFLAGS} -o ${BINARY} cmd/main.go
# Web is a mask to run the web interface, in our case the main function will start the http server.
web:
@clear
@go run cmd/main.go
# Run go formatter
fmt:
@gofmt -w .
# Download the go lint. Not running anything.
lint-prepare:
@echo "Installing golangci-lint"
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s latest
# Run the lint across all the project. See more options https://raw.githubusercontent.com/golangci/golangci-lint .
lint:
./bin/golangci-lint run \
--exclude-use-default=false \
--enable=golint \
--enable=gocyclo \
--enable=goconst \
--enable=unconvert \
./...
# Run the test for all the directories.
test:
@clear
@go test -v ./...
###################
# Docker commands #
###################
up:
docker-compose up
down:
docker-compose down --remove-orphans
clean:
sudo rm -rf db/data