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>
23 lines
391 B
Go
23 lines
391 B
Go
package decoding
|
|
|
|
import (
|
|
"reflect"
|
|
|
|
"github.com/shamaton/msgpack/v2/def"
|
|
)
|
|
|
|
func (d *decoder) asBool(offset int, k reflect.Kind) (bool, int, error) {
|
|
code, offset, err := d.readSize1(offset)
|
|
if err != nil {
|
|
return false, 0, err
|
|
}
|
|
|
|
switch code {
|
|
case def.True:
|
|
return true, offset, nil
|
|
case def.False:
|
|
return false, offset, nil
|
|
}
|
|
return false, 0, d.errorTemplate(code, k)
|
|
}
|