func NewAny(i interface{}) *Any {
	if i == nil {
		return &Any{Value: &Any_NilValue{true}}
	}
	switch val := i.(type) {
	case string:
		return &Any{Value: &Any_StrValue{val}}

	case bool:
		return &Any{Value: &Any_BoolValue{val}}

	case int:
		return &Any{Value: &Any_Int32Value{int32(val)}}

	case int8:
		return &Any{Value: &Any_Int32Value{int32(val)}}

	case int16:
		return &Any{Value: &Any_Int32Value{int32(val)}}

	case int32:
		return &Any{Value: &Any_Int32Value{int32(val)}}

	case int64:
		return &Any{Value: &Any_Int64Value{val}}

	case uint:
		return &Any{Value: &Any_Uint32Value{uint32(val)}}

	case uint8:
		return &Any{Value: &Any_Uint32Value{uint32(val)}}

	case uint16:
		return &Any{Value: &Any_Uint32Value{uint32(val)}}

	case uint32:
		return &Any{Value: &Any_Uint32Value{uint32(val)}}

	case uint64:
		return &Any{Value: &Any_Uint64Value{val}}

	case float32:
		return &Any{Value: &Any_FloatValue{val}}

	case float64:
		return &Any{Value: &Any_DoubleValue{val}}

	case []byte:
		return &Any{Value: &Any_BinaryValue{val}}
	}

	val, err := msgpack.Marshal(i)
	if err != nil {
		return nil
	}
	return &Any{
		Value: &Any_MsgpackValue{val},
	}
}
// NewAny create Any with value, which maybe a bool, int, uint, float, string, array, slice and map
NewAny create Any with value, which maybe a bool, int, uint, float, string, array, slice and map
// NewAny create Any with value which maybe a bool int uint float string array slice and map
func NewAny(i interface{}) *Any {
	if i == nil {
		return &Any{Value: &Any_NilValue{true}}
	}
	switch val := i.(type) {
	case string:
		return &Any{Value: &Any_StrValue{val}}
	case bool:
		return &Any{Value: &Any_BoolValue{val}}
	case int:
		return &Any{Value: &Any_Int32Value{int32(val)}}
	case int8:
		return &Any{Value: &Any_Int32Value{int32(val)}}
	case int16:
		return &Any{Value: &Any_Int32Value{int32(val)}}
	case int32:
		return &Any{Value: &Any_Int32Value{int32(val)}}
	case int64:
		return &Any{Value: &Any_Int64Value{val}}
	case uint:
		return &Any{Value: &Any_Uint32Value{uint32(val)}}
	case uint8:
		return &Any{Value: &Any_Uint32Value{uint32(val)}}
	case uint16:
		return &Any{Value: &Any_Uint32Value{uint32(val)}}
	case uint32:
		return &Any{Value: &Any_Uint32Value{uint32(val)}}
	case uint64:
		return &Any{Value: &Any_Uint64Value{val}}
	case float32:
		return &Any{Value: &Any_FloatValue{val}}
	case float64:
		return &Any{Value: &Any_DoubleValue{val}}
	case []byte:
		return &Any{Value: &Any_BinaryValue{val}}
	}
	val, err := msgpack.Marshal(i)
	if err != nil {
		return nil
	}
	return &Any{
		Value: &Any_MsgpackValue{val},
	}
}
func NewAny ( i interface { } ) * Any { if i == nil { return & Any { Value : & Any_NilValue { true } } } switch val := i . ( type ) { case string : return & Any { Value : & Any_StrValue { val } } case bool : return & Any { Value : & Any_BoolValue { val } } case int : return & Any { Value : & Any_Int32Value { int32 ( val ) } } case int8 : return & Any { Value : & Any_Int32Value { int32 ( val ) } } case int16 : return & Any { Value : & Any_Int32Value { int32 ( val ) } } case int32 : return & Any { Value : & Any_Int32Value { int32 ( val ) } } case int64 : return & Any { Value : & Any_Int64Value { val } } case uint : return & Any { Value : & Any_Uint32Value { uint32 ( val ) } } case uint8 : return & Any { Value : & Any_Uint32Value { uint32 ( val ) } } case uint16 : return & Any { Value : & Any_Uint32Value { uint32 ( val ) } } case uint32 : return & Any { Value : & Any_Uint32Value { uint32 ( val ) } } case uint64 : return & Any { Value : & Any_Uint64Value { val } } case float32 : return & Any { Value : & Any_FloatValue { val } } case float64 : return & Any { Value : & Any_DoubleValue { val } } case [ ] byte : return & Any { Value : & Any_BinaryValue { val } } } val , err := msgpack . Marshal ( i ) if err != nil { return nil } return & Any { Value : & Any_MsgpackValue { val } , } }
NewAny create Any with value, which maybe a bool, int, uint, float, string, array, slice and map
NewAny create Any with value which maybe a bool int uint float string array slice and map