From 151bedcdf52ff88bd99aff7b753ecaad958fd4ea Mon Sep 17 00:00:00 2001 From: Autumn-27 <53844290+Autumn-27@users.noreply.github.com> Date: Fri, 11 Sep 2026 11:10:32 -0400 Subject: [PATCH] =?UTF-8?q?fix(btw):=20=E6=97=A0=20Postgres=20=E6=97=B6?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=E6=97=81=E8=B7=AF=E6=B5=8B=E8=AF=95=EF=BC=8C?= =?UTF-8?q?go.mod=20=E8=A1=A5=20uuid=20=E7=9B=B4=E6=8E=A5=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit server/side_questions_test.go 的 fixture 在拿不到数据库配置时走 t.Fatal, 导致未设置 ARTEX_PG_DSN 的环境跑 go test ./server 直接失败,掩盖真实回归。 改为 t.Skipf,与 server 包其余测试一致。 db/side_questions.go 直接引用 github.com/google/uuid,go mod tidy 将其 从 indirect 移到 direct。 --- go.mod | 2 +- server/side_questions_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 65450c6..2d7fd0a 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.26.3 require ( github.com/Autumn-27/norma v0.3.7 github.com/golang-jwt/jwt/v5 v5.3.1 + github.com/google/uuid v1.6.0 github.com/jackc/pgx/v5 v5.10.0 github.com/klauspost/compress v1.18.6 github.com/lqqyt2423/go-mitmproxy v1.9.2 @@ -24,7 +25,6 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/gaissmai/bart v0.26.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/uuid v1.6.0 // indirect github.com/gorilla/css v1.0.1 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/hinshun/vt10x v0.0.0-20220301184237-5011da428d02 // indirect diff --git a/server/side_questions_test.go b/server/side_questions_test.go index 30e09f1..3ecf648 100644 --- a/server/side_questions_test.go +++ b/server/side_questions_test.go @@ -142,7 +142,7 @@ func newSideHTTPFixture(t *testing.T) *sideHTTPFixture { t.Helper() m, err := NewManager(t.TempDir(), "") if err != nil { - t.Fatal(err) + t.Skipf("postgres unavailable (%v) — skipping", err) } ctx, cancel := context.WithCancel(context.Background()) s := &Server{m: m, engine: NewEngine(m), ctx: ctx, jwtKey: []byte("btw-test-signing-key-only"), chatBusy: map[string]bool{}}