diff options
author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 2022-01-28 23:48:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 23:48:40 +0100 |
commit | 5a1fd7daddbb07b93e3611d023ea48e1991fc0c6 (patch) | |
tree | e592a99163702c4c6214c9519a7983fa58fab13c /vendor/github.com/SevereCloud/vksdk/v2/api/execute.go | |
parent | ac06a268096285a9f795bd19df950075a930c9d6 (diff) | |
download | matterbridge-msglm-5a1fd7daddbb07b93e3611d023ea48e1991fc0c6.tar.gz matterbridge-msglm-5a1fd7daddbb07b93e3611d023ea48e1991fc0c6.tar.bz2 matterbridge-msglm-5a1fd7daddbb07b93e3611d023ea48e1991fc0c6.zip |
Bump github.com/SevereCloud/vksdk/v2 from 2.11.0 to 2.13.0 (#1698)
Bumps [github.com/SevereCloud/vksdk/v2](https://github.com/SevereCloud/vksdk) from 2.11.0 to 2.13.0.
- [Release notes](https://github.com/SevereCloud/vksdk/releases)
- [Commits](https://github.com/SevereCloud/vksdk/compare/v2.11.0...v2.13.0)
---
updated-dependencies:
- dependency-name: github.com/SevereCloud/vksdk/v2
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/SevereCloud/vksdk/v2/api/execute.go')
-rw-r--r-- | vendor/github.com/SevereCloud/vksdk/v2/api/execute.go | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/execute.go b/vendor/github.com/SevereCloud/vksdk/v2/api/execute.go index cc52cd0d..1ee04cee 100644 --- a/vendor/github.com/SevereCloud/vksdk/v2/api/execute.go +++ b/vendor/github.com/SevereCloud/vksdk/v2/api/execute.go @@ -1,6 +1,11 @@ package api -import "encoding/json" +import ( + "bytes" + "encoding/json" + + "github.com/vmihailenco/msgpack/v5" +) // ExecuteWithArgs a universal method for calling a sequence of other methods // while saving and filtering interim results. @@ -26,9 +31,19 @@ func (vk *VK) ExecuteWithArgs(code string, params Params, obj interface{}) error return err } - jsonErr := json.Unmarshal(resp.Response, &obj) - if jsonErr != nil { - return jsonErr + var decoderErr error + + if vk.msgpack { + dec := msgpack.NewDecoder(bytes.NewReader(resp.Response)) + dec.SetCustomStructTag("json") + + decoderErr = dec.Decode(&obj) + } else { + decoderErr = json.Unmarshal(resp.Response, &obj) + } + + if decoderErr != nil { + return decoderErr } if resp.ExecuteErrors != nil { |