func ExampleSum() { in := []int{1, 2, 3, 4} out := generic.Sum(in).(int) fmt.Println(out) // Output: 10 }
func ExampleSum_slice() { in := [][]int{[]int{1, 2}, []int{3, 4}} out := generic.Sum(in).([]int) fmt.Println(out) // Output: [1 2 3 4] }