summaryrefslogtreecommitdiffstats
path: root/model/channel_list.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/channel_list.go')
-rw-r--r--model/channel_list.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/model/channel_list.go b/model/channel_list.go
index 18c726908..d5a4ccb7c 100644
--- a/model/channel_list.go
+++ b/model/channel_list.go
@@ -50,3 +50,14 @@ func ChannelListFromJson(data io.Reader) *ChannelList {
return nil
}
}
+
+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
+ }
+}