chore(deps): remove direct dependency on golang.org/x/exp

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2025-12-31 17:02:52 -05:00
parent fc9817552d
commit 735c0d9103
4 changed files with 12 additions and 11 deletions
+7 -3
View File
@@ -2,11 +2,15 @@ package number
import (
"strconv"
"golang.org/x/exp/constraints"
)
func ParseInt[T constraints.Integer](s string) T {
// Integer is a constraint that permits any integer type.
type Integer interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 |
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}
func ParseInt[T Integer](s string) T {
r, _ := strconv.ParseInt(s, 10, 64)
return T(r)
}