From 19fd0dfb87d64524021e66ba55f4bbd38df44e69 Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 13 Nov 2026 02:00:19 +0800 Subject: [PATCH] catalog: mmddSnapshot compiles on first use 1ca2c62c4 added a package-level regexp.MustCompile, so TestNoEagerPackageRegexps was red (catalog.go:1184). It is a lazyre.New now, as the file's other patterns are, and catalog.go no longer imports regexp. Run (mica): go test -count=1 -tags nogui ./internal/catalog . ok; GOOS=linux and GOOS=windows go vet ./internal/catalog ok. --- internal/catalog/catalog.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/catalog/catalog.go b/internal/catalog/catalog.go index b7d283ca0..4c70047fc 100644 --- a/internal/catalog/catalog.go +++ b/internal/catalog/catalog.go @@ -13,7 +13,6 @@ import ( "net/http" "os" "path/filepath" - "regexp" "slices" "sort" "strconv" @@ -1181,7 +1180,7 @@ func makerPriced(all map[string]mdProvider, at int, prefer []string, id string) // mmddSnapshot is the date a vendor ends a snapshot's id with: -0813, // -1017 (month and day), -20261017 or -2026-10-17. -var mmddSnapshot = regexp.MustCompile(`-(?:(?:0[1-9]|1[0-2])(?:0[1-9]|[12][0-9]|3[01])|20[0-9]{2}(?:-?)(?:0[1-9]|1[0-2])(?:-?)(?:0[1-9]|[12][0-9]|3[01]))$`) +var mmddSnapshot = lazyre.New(`-(?:(?:0[1-9]|1[0-2])(?:0[1-9]|[12][0-9]|3[01])|20[0-9]{2}(?:-?)(?:0[1-9]|1[0-2])(?:-?)(?:0[1-9]|[12][0-9]|3[01]))$`) // snapshotOf is an id without the date of its snapshot, as the model it is // a snapshot of: deepseek-v4.1-flash-1017 is deepseek-v4.1-flash.