summaryrefslogtreecommitdiffstats
path: root/model/channel_list.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-01-30 17:23:00 -0600
committerCorey Hulen <corey@hulen.com>2018-01-30 15:23:00 -0800
commit0c8968fb8df4ce302c928118cd81e75f5bef2861 (patch)
treeb17a2ae5afc98f7ce3daaea10a165d9d647c47c5 /model/channel_list.go
parentac2e42a480c5bba2e5128017218b0fa1bed8e836 (diff)
downloadchat-0c8968fb8df4ce302c928118cd81e75f5bef2861.tar.gz
chat-0c8968fb8df4ce302c928118cd81e75f5bef2861.tar.bz2
chat-0c8968fb8df4ce302c928118cd81e75f5bef2861.zip
unnamed return (#8170)
Diffstat (limited to 'model/channel_list.go')
-rw-r--r--model/channel_list.go20
1 files changed, 5 insertions, 15 deletions
diff --git a/model/channel_list.go b/model/channel_list.go
index d5a4ccb7c..1b3bda46d 100644
--- a/model/channel_list.go
+++ b/model/channel_list.go
@@ -41,23 +41,13 @@ func (o *ChannelList) Etag() string {
}
func ChannelListFromJson(data io.Reader) *ChannelList {
- decoder := json.NewDecoder(data)
- var o ChannelList
- err := decoder.Decode(&o)
- if err == nil {
- return &o
- } else {
- return nil
- }
+ var o *ChannelList
+ json.NewDecoder(data).Decode(&o)
+ return o
}
func ChannelSliceFromJson(data io.Reader) []*Channel {
- decoder := json.NewDecoder(data)
var o []*Channel
- err := decoder.Decode(&o)
- if err == nil {
- return o
- } else {
- return nil
- }
+ json.NewDecoder(data).Decode(&o)
+ return o
}