diff options
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 { |