Skip to content

Instantly share code, notes, and snippets.

// Range runs the given closure on each element of the given list or map. If
// the directive identifies a map, idx will be 0. The index or key will be set
// to the appropriate values for a list or map, respectively, and the other
// will be zero.
//
// Example:
// config.Range("servers", func(i int, _ string, n node) {
// fmt.Printf("server[%d] = %q\n", i, n.(Scalar).String())
// })
// config.Range("users", func(_ int, name string, n node) {