MM-31436: Upgrade dependencies (#16605)
* MM-31436: Upgrade dependencies Ran make update-dependencies https://mattermost.atlassian.net/browse/MM-31436 ```release-note NONE ``` * add missing dep * fix lru marshaling
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
09d2f698cc
Коммит
091659c8ad
37
vendor/github.com/vmihailenco/msgpack/v5/encode_value.go
сгенерированный
поставляемый
37
vendor/github.com/vmihailenco/msgpack/v5/encode_value.go
сгенерированный
поставляемый
@@ -12,12 +12,12 @@ var valueEncoders []encoderFunc
|
||||
func init() {
|
||||
valueEncoders = []encoderFunc{
|
||||
reflect.Bool: encodeBoolValue,
|
||||
reflect.Int: encodeInt64CondValue,
|
||||
reflect.Int: encodeIntValue,
|
||||
reflect.Int8: encodeInt8CondValue,
|
||||
reflect.Int16: encodeInt16CondValue,
|
||||
reflect.Int32: encodeInt32CondValue,
|
||||
reflect.Int64: encodeInt64CondValue,
|
||||
reflect.Uint: encodeUint64CondValue,
|
||||
reflect.Uint: encodeUintValue,
|
||||
reflect.Uint8: encodeUint8CondValue,
|
||||
reflect.Uint16: encodeUint16CondValue,
|
||||
reflect.Uint32: encodeUint32CondValue,
|
||||
@@ -66,6 +66,9 @@ func _getEncoder(typ reflect.Type) encoderFunc {
|
||||
if typ.Implements(binaryMarshalerType) {
|
||||
return marshalBinaryValue
|
||||
}
|
||||
if typ.Implements(textMarshalerType) {
|
||||
return marshalTextValue
|
||||
}
|
||||
|
||||
// Addressable struct field value.
|
||||
if kind != reflect.Ptr {
|
||||
@@ -77,7 +80,10 @@ func _getEncoder(typ reflect.Type) encoderFunc {
|
||||
return marshalValuePtr
|
||||
}
|
||||
if ptr.Implements(binaryMarshalerType) {
|
||||
return marshalBinaryValuePtr
|
||||
return marshalBinaryValueAddr
|
||||
}
|
||||
if ptr.Implements(textMarshalerType) {
|
||||
return marshalTextValueAddr
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +200,7 @@ func nilable(v reflect.Value) bool {
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
func marshalBinaryValuePtr(e *Encoder, v reflect.Value) error {
|
||||
func marshalBinaryValueAddr(e *Encoder, v reflect.Value) error {
|
||||
if !v.CanAddr() {
|
||||
return fmt.Errorf("msgpack: Encode(non-addressable %T)", v.Interface())
|
||||
}
|
||||
@@ -214,3 +220,26 @@ func marshalBinaryValue(e *Encoder, v reflect.Value) error {
|
||||
|
||||
return e.EncodeBytes(data)
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
func marshalTextValueAddr(e *Encoder, v reflect.Value) error {
|
||||
if !v.CanAddr() {
|
||||
return fmt.Errorf("msgpack: Encode(non-addressable %T)", v.Interface())
|
||||
}
|
||||
return marshalTextValue(e, v.Addr())
|
||||
}
|
||||
|
||||
func marshalTextValue(e *Encoder, v reflect.Value) error {
|
||||
if nilable(v) && v.IsNil() {
|
||||
return e.EncodeNil()
|
||||
}
|
||||
|
||||
marshaler := v.Interface().(encoding.TextMarshaler)
|
||||
data, err := marshaler.MarshalText()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return e.EncodeBytes(data)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user