diff options
author | George Goldberg <george@gberg.me> | 2018-02-06 17:25:53 +0000 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2018-02-06 17:25:53 +0000 |
commit | 7941c30117efe1b957ac0458c2f0479e3824196d (patch) | |
tree | df791632a9dc790a6f73dec53aae3ba919ebda63 /model/channel_member.go | |
parent | e1cd64613591cf5a990442a69ebf188258bd0cb5 (diff) | |
parent | 034dbc07e3068c482e654b6a1a8fcbe4b01c44f3 (diff) | |
download | chat-7941c30117efe1b957ac0458c2f0479e3824196d.tar.gz chat-7941c30117efe1b957ac0458c2f0479e3824196d.tar.bz2 chat-7941c30117efe1b957ac0458c2f0479e3824196d.zip |
Merge branch 'master' into advanced-permissions-phase-1
Diffstat (limited to 'model/channel_member.go')
-rw-r--r-- | model/channel_member.go | 49 |
1 files changed, 13 insertions, 36 deletions
diff --git a/model/channel_member.go b/model/channel_member.go index e7ad8232a..e9895aea0 100644 --- a/model/channel_member.go +++ b/model/channel_member.go @@ -49,54 +49,31 @@ func (o *ChannelMembers) ToJson() string { } func (o *ChannelUnread) ToJson() string { - b, err := json.Marshal(o) - if err != nil { - return "" - } else { - return string(b) - } + b, _ := json.Marshal(o) + return string(b) } func ChannelMembersFromJson(data io.Reader) *ChannelMembers { - decoder := json.NewDecoder(data) - var o ChannelMembers - err := decoder.Decode(&o) - if err == nil { - return &o - } else { - return nil - } + var o *ChannelMembers + json.NewDecoder(data).Decode(&o) + return o } func ChannelUnreadFromJson(data io.Reader) *ChannelUnread { - decoder := json.NewDecoder(data) - var o ChannelUnread - err := decoder.Decode(&o) - if err == nil { - return &o - } else { - return nil - } + var o *ChannelUnread + json.NewDecoder(data).Decode(&o) + return o } func (o *ChannelMember) ToJson() string { - b, err := json.Marshal(o) - if err != nil { - return "" - } else { - return string(b) - } + b, _ := json.Marshal(o) + return string(b) } func ChannelMemberFromJson(data io.Reader) *ChannelMember { - decoder := json.NewDecoder(data) - var o ChannelMember - err := decoder.Decode(&o) - if err == nil { - return &o - } else { - return nil - } + var o *ChannelMember + json.NewDecoder(data).Decode(&o) + return o } func (o *ChannelMember) IsValid() *AppError { |