Fix generation of url regex for Go

This commit is contained in:
Kovid Goyal
2023-03-09 18:59:09 +05:30
parent 2aa9187428
commit 0e5ed29d83
7 changed files with 38 additions and 19 deletions

View File

@@ -57,8 +57,8 @@ func Filter[T any](s []T, f func(x T) bool) []T {
return ans
}
func Map[T any](f func(x T) T, s []T) []T {
ans := make([]T, 0, len(s))
func Map[T any, O any](f func(x T) O, s []T) []O {
ans := make([]O, 0, len(s))
for _, x := range s {
ans = append(ans, f(x))
}