chore(deps): bump github.com/shamaton/msgpack/v2 from 2.2.0 to 2.2.2

Bumps [github.com/shamaton/msgpack/v2](https://github.com/shamaton/msgpack) from 2.2.0 to 2.2.2.
- [Release notes](https://github.com/shamaton/msgpack/releases)
- [Commits](https://github.com/shamaton/msgpack/compare/v2.2.0...v2.2.2)

---
updated-dependencies:
- dependency-name: github.com/shamaton/msgpack/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2024-09-23 12:57:52 +02:00
committed by Ralf Haferkamp
parent 54c8567697
commit b3e5d80306
31 changed files with 180 additions and 197 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ func (e *encoder) calcByteSlice(l int) (int, error) {
return def.Byte4 + l, nil
}
// not supported error
return 0, fmt.Errorf("not support this array length : %d", l)
return 0, fmt.Errorf("%w slice length : %d", def.ErrUnsupportedType, l)
}
func (e *encoder) writeByteSliceLength(l int, offset int) int {
+5 -5
View File
@@ -45,7 +45,7 @@ func Encode(v interface{}, asArray bool) (b []byte, err error) {
e.d = make([]byte, size)
last := e.create(rv, 0)
if size != last {
return nil, fmt.Errorf("failed serialization size=%d, lastIdx=%d", size, last)
return nil, fmt.Errorf("%w size=%d, lastIdx=%d", def.ErrNotMatchLastIndex, size, last)
}
return e.d, err
}
@@ -116,7 +116,7 @@ func (e *encoder) calcSize(rv reflect.Value) (int, error) {
ret += def.Byte4
} else {
// not supported error
return 0, fmt.Errorf("not support this array length : %d", l)
return 0, fmt.Errorf("%w array length : %d", def.ErrUnsupportedType, l)
}
if size, find := e.calcFixedSlice(rv); find {
@@ -164,7 +164,7 @@ func (e *encoder) calcSize(rv reflect.Value) (int, error) {
ret += def.Byte4
} else {
// not supported error
return 0, fmt.Errorf("not support this array length : %d", l)
return 0, fmt.Errorf("array length %d is %w", l, def.ErrUnsupportedLength)
}
// func
@@ -201,7 +201,7 @@ func (e *encoder) calcSize(rv reflect.Value) (int, error) {
ret += def.Byte4
} else {
// not supported error
return 0, fmt.Errorf("not support this map length : %d", l)
return 0, fmt.Errorf("map length %d is %w", l, def.ErrUnsupportedLength)
}
if size, find := e.calcFixedMap(rv); find {
@@ -262,7 +262,7 @@ func (e *encoder) calcSize(rv reflect.Value) (int, error) {
// do nothing (return nil)
default:
return 0, fmt.Errorf("type(%v) is unsupported", rv.Kind())
return 0, fmt.Errorf("%v is %w type", rv.Kind(), def.ErrUnsupportedType)
}
return ret, nil
+2 -2
View File
@@ -95,7 +95,7 @@ func (e *encoder) calcStructArray(rv reflect.Value) (int, error) {
ret += def.Byte4
} else {
// not supported error
return 0, fmt.Errorf("not support this array length : %d", l)
return 0, fmt.Errorf("array length %d is %w", l, def.ErrUnsupportedLength)
}
return ret, nil
}
@@ -142,7 +142,7 @@ func (e *encoder) calcStructMap(rv reflect.Value) (int, error) {
ret += def.Byte4
} else {
// not supported error
return 0, fmt.Errorf("not support this array length : %d", l)
return 0, fmt.Errorf("map length %d is %w", l, def.ErrUnsupportedLength)
}
return ret, nil
}