Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumGogenerics type parametersSingle-choice MCQ

Which statement about type inference in this call is correct?

func Map[T, U any](s []T, f func(T) U) []U { r := make([]U, len(s)) for i, v := range s { r[i] = f(v) } return r } func main() { _ = Map([]int{1, 2}, func(x int) string { return "" }) }