-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (35 loc) · 913 Bytes
/
Makefile
File metadata and controls
45 lines (35 loc) · 913 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
40
41
42
43
44
45
.PHONY: all build test test-cover test-race lint clean install generate
# Default target
all: lint test build
# Generate code (downloads fresh IATA data)
generate:
go generate ./...
# Build the binary
build:
go build -o t ./cmd/t
# Install the binary
install:
go install ./cmd/t
# Run tests
test:
go test ./...
# Run tests with coverage
test-cover:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report: coverage.html"
# Run tests with race detector
test-race:
go test -race ./...
# Run linters
lint:
@which golangci-lint > /dev/null || (echo "Installing golangci-lint..." && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)
golangci-lint run
go vet ./...
# Format code
fmt:
gofmt -w .
@which goimports > /dev/null && goimports -w . || true
# Clean build artifacts
clean:
rm -f t coverage.out coverage.html