add import storage and test

This commit is contained in:
adman
2026-04-23 22:36:34 +02:00
parent 841d91b91d
commit bd3139754d
5 changed files with 116 additions and 2 deletions
+16
View File
@@ -65,3 +65,19 @@ func MinSlice[T cmp.Ordered](s []T) (ret T) {
}
return
}
type Numeric interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 |
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
~float32 | ~float64
}
func SliceRange[T Numeric](s, e T) (ret []T) {
if s > e {
return
}
for v := s; v < e; v++ {
ret = append(ret, v)
}
return
}