summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/SevereCloud/vksdk/v2/object/users.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-05-30 00:25:30 +0200
committerGitHub <noreply@github.com>2021-05-30 00:25:30 +0200
commit4091b6f6b4fe01876f8720332675f9c69be39541 (patch)
tree07a1f2b2eeba6fb680b5edc19d2d38ec81243c0a /vendor/github.com/SevereCloud/vksdk/v2/object/users.go
parent766f35554e16ee5462370be714ef29b71745d478 (diff)
downloadmatterbridge-msglm-4091b6f6b4fe01876f8720332675f9c69be39541.tar.gz
matterbridge-msglm-4091b6f6b4fe01876f8720332675f9c69be39541.tar.bz2
matterbridge-msglm-4091b6f6b4fe01876f8720332675f9c69be39541.zip
Update vendor (#1498)
Diffstat (limited to 'vendor/github.com/SevereCloud/vksdk/v2/object/users.go')
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/users.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/users.go b/vendor/github.com/SevereCloud/vksdk/v2/object/users.go
index 07e1049f..c578c489 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/users.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/users.go
@@ -1,6 +1,8 @@
package object // import "github.com/SevereCloud/vksdk/v2/object"
import (
+ "bytes"
+ "encoding/json"
"fmt"
)
@@ -233,6 +235,28 @@ type UsersPersonal struct {
ReligionID int `json:"religion_id"`
}
+// UnmarshalJSON UsersPersonal.
+//
+// BUG(VK): UsersPersonal return [].
+func (personal *UsersPersonal) UnmarshalJSON(data []byte) error {
+ if bytes.Equal(data, []byte("[]")) {
+ return nil
+ }
+
+ type renamedUsersPersonal UsersPersonal
+
+ var r renamedUsersPersonal
+
+ err := json.Unmarshal(data, &r)
+ if err != nil {
+ return err
+ }
+
+ *personal = UsersPersonal(r)
+
+ return nil
+}
+
// UsersRelative struct.
type UsersRelative struct {
BirthDate string `json:"birth_date"` // Date of child birthday (format dd.mm.yyyy)