func WrapRanger(v interface{}) (Ranger, bool) {
	r, ok := v.(Ranger)
	if ok {
		return r, ok
	}
	rv := reflect.ValueOf(v)
	switch rv.Kind() {
	case reflect.String, reflect.Slice, reflect.Array:
		return indexRanger{rv}, true
	case reflect.Map:
		return mapRanger{rv}, true
	}
	return nil, false
}
WrapRanger returns Ranger, true if v can be ranged over and nil, false otherwise.
package test
import (
	"fmt"
	"reflect"
	"github.com/kr/pretty"
)
func StringEqual(x, y string) bool {
	return x == y
}
func DiffEqual(x, y interface{}) bool {
	return len(pretty.Diff(x, y)) == 0
}
type Ranger interface {
	Range(f func(k, v interface{}) bool)
}
type indexRanger struct {
	reflect.Value
}
func (rv indexRanger) Range(f func(k, v interface{}) bool) {
	for i := 0; i < rv.Len(); i++ {
		if !f(i, rv.Index(i).Interface()) {
			return
		}
	}
}
type mapRanger struct {
	reflect.Value
}
func (rv mapRanger) Range(f func(k, v interface{}) bool) {
	for _, k := range rv.MapKeys() {
		if !f(k.Interface(), rv.MapIndex(k).Interface()) {
			return
		}
	}
}