From afe9affc2aea5b84d936c257ad853a58770e4d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=AB=A0=E6=B5=A9?= Date: Fri, 30 Oct 2026 16:16:45 +0800 Subject: [PATCH] =?UTF-8?q?style:=20gofmt=20=E6=96=B0=E5=A2=9E=E7=9A=84?= =?UTF-8?q?=E4=B8=89=E4=B8=AA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为什么:远端 CI 的格式门在推送后判红(run 258,job build,format=failure), 本地 `make verify` 那次跑的是"拉取前"的文件集,漏掉了随后新增/改写的三个文件。 失败项:internal/httpapi/library_intent_test.go、internal/jobs/lease_loss_test.go、 internal/platform/postgres/library_protection.go。 怎么验:`gofmt -l internal/ cmd/` 输出为空;`python3 scripts/check_format.py` rc=0 (Go:✅,前端:✅)。只改空白,不改逻辑。 --- internal/httpapi/library_intent_test.go | 2 +- internal/jobs/lease_loss_test.go | 2 +- internal/platform/postgres/library_protection.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/httpapi/library_intent_test.go b/internal/httpapi/library_intent_test.go index 6d990b2..4dcc7f8 100644 --- a/internal/httpapi/library_intent_test.go +++ b/internal/httpapi/library_intent_test.go @@ -122,4 +122,4 @@ func TestCreateJobRejectsReservedLibraryTypes(t *testing.T) { if !strings.Contains(recorder.Body.String(), "发布管理专用入口") { t.Fatalf("拒绝原因必须指向专用入口:%s", recorder.Body.String()) } -} \ No newline at end of file +} diff --git a/internal/jobs/lease_loss_test.go b/internal/jobs/lease_loss_test.go index 0e6efc8..f8fda9e 100644 --- a/internal/jobs/lease_loss_test.go +++ b/internal/jobs/lease_loss_test.go @@ -48,4 +48,4 @@ func TestLeaseLossMustCancelHandler(t *testing.T) { if continued { t.Fatal("心跳报失租后 handler 仍在运行:旧代次还能继续写目标") } -} \ No newline at end of file +} diff --git a/internal/platform/postgres/library_protection.go b/internal/platform/postgres/library_protection.go index c66f152..84cf635 100644 --- a/internal/platform/postgres/library_protection.go +++ b/internal/platform/postgres/library_protection.go @@ -139,4 +139,4 @@ SELECT coalesce(snapshot_id,''), coalesce(target_snapshot_id,'') FROM library_jo add(target, "未释放维护窗口的目标快照") } return protected, nil -} \ No newline at end of file +}