mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-02-09 07:53:14 +08:00
41 lines
602 B
Makefile
41 lines
602 B
Makefile
.PHONY: build run test lint clean
|
|
|
|
# Build the server binary
|
|
build:
|
|
go build -o bin/server ./cmd/server
|
|
|
|
# Run the server
|
|
run:
|
|
go run ./cmd/server
|
|
|
|
# Run tests
|
|
test:
|
|
go test -v ./...
|
|
|
|
# Run tests with coverage
|
|
test-coverage:
|
|
go test -v -coverprofile=coverage.out ./...
|
|
go tool cover -html=coverage.out -o coverage.html
|
|
|
|
# Run linter
|
|
lint:
|
|
golangci-lint run ./...
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
rm -rf bin/
|
|
rm -f coverage.out coverage.html
|
|
|
|
# Download dependencies
|
|
deps:
|
|
go mod download
|
|
go mod tidy
|
|
|
|
# Format code
|
|
fmt:
|
|
go fmt ./...
|
|
|
|
# Generate mocks (if needed)
|
|
generate:
|
|
go generate ./...
|