diff --git a/Dockerfile b/Dockerfile index bbef7ef..711a5c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.26.6-alpine AS builder +FROM golang:1.26.10-alpine AS builder WORKDIR /build diff --git a/Makefile b/Makefile index 660349d..f9039ee 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ LISTEN ?= :18080 DATA_ROOT ?= ../http-mock-data ROUTES ?= routes/*.yaml -.PHONY: help fmt test build run validate +.PHONY: help fmt test test-race build ci run validate help: ## 显示常用命令 @awk 'BEGIN {FS = ":.*## "}; /^[a-zA-Z0-9_.-]+:.*## / {printf "%-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST) @@ -16,9 +16,14 @@ fmt: ## Go 代码格式化 test: ## 运行测试 go test ./... +test-race: ## 运行竞态检测测试 + go test -race ./... + build: ## 编译检查 go build ./cmd/http-mock +ci: test test-race build ## 本地模拟 CI 核心检查 + run: ## 启动 http-mock 服务 go run ./cmd/http-mock serve --routes "$(ROUTES)" --data-root "$(DATA_ROOT)" --listen "$(LISTEN)" diff --git a/go.mod b/go.mod index 39a80c8..178d3d5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/edgefn/http-mock -go 1.26.6 +go 1.26.10 require ( github.com/tidwall/gjson v1.18.0