Added convs.
This commit is contained in:
parent
0a23c4a5a4
commit
28536eb2e0
1 changed files with 19 additions and 0 deletions
|
@ -14,3 +14,22 @@ func MakeMap[K comparable, V any](
|
|||
|
||||
return r
|
||||
}
|
||||
|
||||
func ConvStr[V1, V2 ~string](v1 []V1) []V2 {
|
||||
ret := []V2{}
|
||||
for i := range v1 {
|
||||
ret = append(ret, V2(v1[i]))
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func ConvInt[V1, V2 ~int](v1 []V1) []V2 {
|
||||
ret := []V2{}
|
||||
for i := range v1 {
|
||||
ret = append(ret, V2(v1[i]))
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue