diff options
Diffstat (limited to 'model/channel_list.go')
-rw-r--r-- | model/channel_list.go | 20 |
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 } |