From 8a4b2e83a5a4850d765018d70d07bf26e72808f7 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Sun, 4 Aug 2013 17:17:40 -0700 Subject: [PATCH] change create->new, follow go spec --- command.go | 2 +- store/store.go | 2 +- store/watcher.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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)} }