func coerce(v interface{}) interface{} {
	switch val := v.(type) {
	case string:
		return v
	// Yes, these are all the same, however we can't put them into a single
	// case, or the value becomes interface{}, which can't be converted to a
	// float64.
	case int:
		return float64(val)
	case int8:
		return float64(val)
	case int16:
		return float64(val)
	case int32:
		return float64(val)
	case int64:
		return float64(val)
	case uint:
		return float64(val)
	case uint8:
		return float64(val)
	case uint16:
		return float64(val)
	case uint32:
		return float64(val)
	case uint64:
		return float64(val)
	case float32:
		return float64(val)
	case float64:
		return val
	}
	return v
}
// coerce returns v in a format that allows constraint values to be easily
// compared. Its main purpose is to cast all numeric values to float64 (since
// the numbers we compare are generated from json serialization).
coerce returns v in a format that allows constraint values to be easily
compared. Its main purpose is to cast all numeric values to float64 (since
the numbers we compare are generated from json serialization).
// coerce returns v in a format that allows constraint values to be easily // compared . Its main purpose is to cast all numeric values to float64 ( since // the numbers we compare are generated from json serialization ) .
func coerce(v interface{}) interface{} {
	switch val := v.(type) {
	case string:
		return v
	case int:
		return float64(val)
	case int8:
		return float64(val)
	case int16:
		return float64(val)
	case int32:
		return float64(val)
	case int64:
		return float64(val)
	case uint:
		return float64(val)
	case uint8:
		return float64(val)
	case uint16:
		return float64(val)
	case uint32:
		return float64(val)
	case uint64:
		return float64(val)
	case float32:
		return float64(val)
	case float64:
		return val
	}
	return v
}
func coerce ( v interface { } ) interface { } { switch val := v . ( type ) { case string : return v case int : return float64 ( val ) case int8 : return float64 ( val ) case int16 : return float64 ( val ) case int32 : return float64 ( val ) case int64 : return float64 ( val ) case uint : return float64 ( val ) case uint8 : return float64 ( val ) case uint16 : return float64 ( val ) case uint32 : return float64 ( val ) case uint64 : return float64 ( val ) case float32 : return float64 ( val ) case float64 : return val } return v }
coerce returns v in a format that allows constraint values to be easily
compared.
coerce returns v in a format that allows constraint values to be easily compared .
// Yes, these are all the same, however we can't put them into a single // case, or the value becomes interface{}, which can't be converted to a // float64.