Documentation
¶
Overview ¶
Package ranger provides the Ranger interface that iterates over a set of values, and some implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ranger ¶
type Ranger interface { // Next advances the ranger to the next value in the set. It returns whether it was successful in advancing. Next() bool // Value returns the current value in the set. Value panics if Next has not been called or if // there are no more values. Value() interface{} // Status returns the current iteration status. Status panics if Next has not been called or if // there are no more values. Status() Status }
Ranger iterates over a set of values and returns the current value for each iteration.
func New ¶
func New(v interface{}) Ranger
New returns a ranger that iterates over a slice, an array, or a hash. New panics if v is nil, or if it is of another type. If v is a hash, the ranger will produce HashEntry elements.
Click to show internal directories.
Click to hide internal directories.