YTSFlix_Go/vendor/github.com/bradfitz/iter/iter.go

18 lines
404 B
Go
Raw Normal View History

2018-11-04 14:58:15 +00:00
// Package iter provides a syntantically different way to iterate over integers. That's it.
package iter
// N returns a slice of n 0-sized elements, suitable for ranging over.
//
// For example:
//
// for i := range iter.N(10) {
// fmt.Println(i)
// }
//
// ... will print 0 to 9, inclusive.
//
// It does not cause any allocations.
func N(n int) []struct{} {
return make([]struct{}, n)
}