-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (46 loc) · 1.14 KB
/
Copy pathMakefile
File metadata and controls
56 lines (46 loc) · 1.14 KB
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
52
53
54
55
56
.PHONY: run build clean test lint dev
# Default target
all: run
# Run the application
run:
go run ./src/cmd/server
# Run with hot reload using Air
dev:
air
# Build the application
build:
go build -o app ./src/cmd/server
# Clean build artifacts
clean:
rm -f app
rm -rf pb_data
# Install dependencies
deps:
go mod tidy
# Run tests
test:
go test -v ./...
# Run tests with coverage
test-coverage:
go test -v -coverprofile=coverage.txt -covermode=atomic ./...
go tool cover -html=coverage.txt -o coverage.html
# Lint the code
lint:
go vet ./...
@if command -v golangci-lint >/dev/null 2>&1; then \
golangci-lint run; \
else \
echo "golangci-lint not installed, skipping"; \
fi
# Help
help:
@echo "Available targets:"
@echo " run - Run the application"
@echo " dev - Run with hot reload using Air"
@echo " build - Build the application"
@echo " clean - Clean build artifacts"
@echo " deps - Install dependencies"
@echo " test - Run tests"
@echo " test-coverage - Run tests with coverage"
@echo " lint - Lint the code"
@echo " help - Show this help message"