summaryrefslogtreecommitdiffstats
path: root/store/store.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-07-06 00:50:42 -0800
committer=Corey Hulen <corey@hulen.com>2015-07-06 00:50:42 -0800
commit34fb817a4a4cd2761ba35a2c94f9d0eb79d06244 (patch)
treeeaf0ecaf55383449a5b2cc369fa8112109da7f0d /store/store.go
parentcbadc263864b1b0196b90b9afa1c68335f0ab7f1 (diff)
downloadchat-34fb817a4a4cd2761ba35a2c94f9d0eb79d06244.tar.gz
chat-34fb817a4a4cd2761ba35a2c94f9d0eb79d06244.tar.bz2
chat-34fb817a4a4cd2761ba35a2c94f9d0eb79d06244.zip
Fixing unit tests
Diffstat (limited to 'store/store.go')
-rw-r--r--store/store.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/store/store.go b/store/store.go
index 8d4b49b6e..070ee0562 100644
--- a/store/store.go
+++ b/store/store.go
@@ -14,6 +14,15 @@ type StoreResult struct {
type StoreChannel chan StoreResult
+func Must(sc StoreChannel) interface{} {
+ r := <-sc
+ if r.Err != nil {
+ panic(r.Err)
+ }
+
+ return r.Data
+}
+
type Store interface {
Team() TeamStore
Channel() ChannelStore