-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (43 loc) · 1.04 KB
/
Copy pathMakefile
File metadata and controls
56 lines (43 loc) · 1.04 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: all test lint build clean example update-data
# Default target
all: lint test build
# Run tests
test:
go test -v -race -cover ./...
# Run tests with coverage report
coverage:
go test -v -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report: coverage.html"
# Run linter
lint:
golangci-lint run
# Build the package
build:
go build ./...
# Build example
example:
go build -o bin/example ./example/...
# Run example
run-example:
go run ./example/...
# Clean build artifacts
clean:
rm -rf bin/ dist/ coverage.out coverage.html
go clean
# Update embedded data from cloudip-db (downloads, verifies SHA-256, validates)
update-data:
go run ./scripts/fetch-data
@echo "Data updated. Don't forget to commit the changes."
# Run benchmarks
bench:
go test -bench=. -benchmem ./...
# Check for outdated dependencies
deps:
go list -u -m all
# Tidy dependencies
tidy:
go mod tidy
# Install development tools
tools:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest