diff --git a/command.go b/command.go index 209a7d792..3ad371819 100644 --- a/command.go +++ b/command.go @@ -93,7 +93,7 @@ func (c *WatchCommand) CommandName() string { func (c *WatchCommand) Apply(server *raft.Server) (interface{}, error) { // create a new watcher - watcher := store.CreateWatcher() + watcher := store.NewWatcher() // add to the watchers list etcdStore.AddWatcher(c.Key, watcher, c.SinceIndex) diff --git a/store/store.go b/store/store.go index 000f725ac..ae6a759f2 100644 --- a/store/store.go +++ b/store/store.go @@ -126,7 +126,7 @@ func CreateStore(max int) *Store { }, } - s.watcher = createWatcherHub() + s.watcher = newWatcherHub() return s } diff --git a/store/watcher.go b/store/watcher.go index 6bc353f58..dfd91774a 100644 --- a/store/watcher.go +++ b/store/watcher.go @@ -23,14 +23,14 @@ type Watcher struct { } // Create a new watcherHub -func createWatcherHub() *WatcherHub { +func newWatcherHub() *WatcherHub { w := new(WatcherHub) w.watchers = make(map[string][]*Watcher) return w } // Create a new watcher -func CreateWatcher() *Watcher { +func NewWatcher() *Watcher { return &Watcher{C: make(chan *Response, 1)} }