code: func convertNumber(v reflect.Value, to reflect.Kind) (reflect.Value, error) {
  	var n reflect.Value
  	if isFloat(to) {
  		f, err := toFloat(v)
  		if err != nil {
  			return n, err
  		}
  		switch to {
  		case reflect.Float32:
  			n = reflect.ValueOf(float32(f))
  		default:
  			n = reflect.ValueOf(float64(f))
  		}
  	} else if isInt(to) {
  		i, err := toInt(v)
  		if err != nil {
  			return n, err
  		}
  		switch to {
  		case reflect.Int:
  			n = reflect.ValueOf(int(i))
  		case reflect.Int8:
  			n = reflect.ValueOf(int8(i))
  		case reflect.Int16:
  			n = reflect.ValueOf(int16(i))
  		case reflect.Int32:
  			n = reflect.ValueOf(int32(i))
  		case reflect.Int64:
  			n = reflect.ValueOf(int64(i))
  		}
  	} else if isUint(to) {
  		i, err := toUint(v)
  		if err != nil {
  			return n, err
  		}
  		switch to {
  		case reflect.Uint:
  			n = reflect.ValueOf(uint(i))
  		case reflect.Uint8:
  			n = reflect.ValueOf(uint8(i))
  		case reflect.Uint16:
  			n = reflect.ValueOf(uint16(i))
  		case reflect.Uint32:
  			n = reflect.ValueOf(uint32(i))
  		case reflect.Uint64:
  			n = reflect.ValueOf(uint64(i))
  		}
  
  	}
  
  	if !n.IsValid() {
  		return n, errors.New("invalid values")
  	}
  
  	return n, nil
  
  }
docs: // There are potential overflows in this function, but the downconversion of
  // int64 etc. into int8 etc. is coming from the synthetic unit tests for Union etc.
  // TODO(bep) We should consider normalizing the slices to int64 etc.