func ExampleTo() { for i := range ranging.To(5) { fmt.Println(i) } //Output: 0 //1 //2 //3 //4 }
func TestSimpleRange(t *testing.T) { r := ranging.To(100) for i := 0; i < 100; i++ { v := <-r if i != int(v) { t.Errorf("Expected: %d Got: %d", i, v) } } }