go-pattern-examples/gomore/27_messages/message_test.go

16 lines
246 B
Go
Raw Normal View History

2020-04-28 17:48:25 +03:00
package gomore
import "testing"
func TestMessageSubAndPub(t *testing.T) {
//创建一个队列
msgQueue := MesssageQueue{Topics: map[uint64]*Topic{}}
//创建一个话题
topic := Topic{}
//像队列订阅话题
topic.Subscribe(123)
}