// resolveInt will resolve an int to one of the 4 compatible types.
resolveInt will resolve an int to one of the 4 compatible types.
// resolveInt will resolve an int to one of the 4 compatible types .
func (m MetricType) resolveInt(val interface{}) interface{} {
	if vi, isInt := val.(int); isInt {
		switch m {
		case Int64Type:
			return int64(vi)
		case Uint32Type:
			return uint32(vi)
		case Uint64Type:
			return uint64(vi)
		}
		return int32(val.(int))
	}
	if vui, isUint := val.(uint); isUint {
		if m == Uint64Type {
			return uint64(vui)
		}
		return uint32(vui)
	}
	return val
}
func ( m MetricType ) resolveInt ( val interface { } ) interface { } { if vi , isInt := val . ( int ) ; isInt { switch m { case Int64Type : return int64 ( vi ) case Uint32Type : return uint32 ( vi ) case Uint64Type : return uint64 ( vi ) } return int32 ( val . ( int ) ) } if vui , isUint := val . ( uint ) ; isUint { if m == Uint64Type { return uint64 ( vui ) } return uint32 ( vui ) } return val }
resolveInt will resolve an int to one of the 4 compatible types.
resolveInt will resolve an int to one of the 4 compatible types .