This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 6ea77c926 fix(core): replace constraints.Unsigned with local interface
in archived base (#9032)
6ea77c926 is described below
commit 6ea77c9265dc4b040347effe425ad21f3a74df6d
Author: Francisc Munteanu <[email protected]>
AuthorDate: Thu Aug 6 09:54:57 2026 +0200
fix(core): replace constraints.Unsigned with local interface in archived
base (#9032)
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 <[email protected]>
---
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 7af72cd65..1ece65438 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"`