You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
276 B
Go
20 lines
276 B
Go
3 years ago
|
package iter
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
"strconv"
|
||
|
)
|
||
|
|
||
|
func TestSlice(t *testing.T) {
|
||
|
nums := []int{1, 2, 3, 4, 5}
|
||
|
s := Slice(nums)
|
||
|
for n, it := Start(s); it.Next(&n); {
|
||
|
t.Log(n)
|
||
|
}
|
||
|
|
||
|
|
||
|
for n, it := Start(Map(Slice(nums), strconv.Itoa)); it.Next(&n); {
|
||
|
t.Log("fart " + n)
|
||
|
}
|
||
|
}
|