From e437bd2932da6b13d190ca523bc484212d70d5ef Mon Sep 17 00:00:00 2001 From: fmuntean Date: Tue, 4 Aug 2026 17:01:23 +0200 Subject: [PATCH] fix(core): replace constraints.Unsigned with local interface in archived base Recent golang.org/x/exp requires Go 1.23+, which breaks golangci-lint typecheck on older CI. Inline the Unsigned constraint to drop the import. Co-authored-by: Cursor --- backend/core/models/migrationscripts/archived/base.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/core/models/migrationscripts/archived/base.go b/backend/core/models/migrationscripts/archived/base.go index 7af72cd65d8..1ece6543821 100644 --- a/backend/core/models/migrationscripts/archived/base.go +++ b/backend/core/models/migrationscripts/archived/base.go @@ -19,8 +19,6 @@ package archived import ( "time" - - "golang.org/x/exp/constraints" ) type DomainEntity struct { @@ -44,7 +42,14 @@ type ScopeConfig struct { Entities []string `gorm:"type:json;serializer:json" json:"entities" mapstructure:"entities"` } -type GenericModel[T string | constraints.Unsigned] struct { +// unsignedInteger matches all unsigned integer types, replacing +// golang.org/x/exp/constraints.Unsigned to avoid a transitive dependency +// on that module which requires Go 1.23+ in recent versions. +type unsignedInteger interface { + ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr +} + +type GenericModel[T string | unsignedInteger] struct { ID T `gorm:"primaryKey" json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"`