From 0de9922e7d584a6f738c6e7c6a6692a61b25bd43 Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 30 Apr 2026 00:05:54 +0800 Subject: [PATCH] fix(makefile): restrict bench target to internal directory - Change ./... to ./internal/... to avoid scanning lib/fasthttp - Add -run=^$$ to skip regular tests, run only benchmarks - Properly escape $ in Makefile with $$ Co-Authored-By: Claude Opus 4.7 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6525f87..bfeb2a0 100644 --- a/Makefile +++ b/Makefile @@ -214,10 +214,10 @@ act-unit: exit 1; \ fi -# 运行基准测试(输出到文件) +# 运行基准测试(输出到文件,仅扫描 internal 目录) bench: @echo "Running benchmarks..." - go test -bench=. -benchmem -count=5 ./... 2>&1 | tee bench-results.txt + go test -bench=. -benchmem -count=5 -run=^$$ ./internal/... | tee bench-results.txt # 运行基准测试(统计模式,10次采样) bench-stat: