Browse Source

change create->new, follow go spec

Xiang Li 12 years ago
parent
commit
8a4b2e83a5
3 changed files with 4 additions and 4 deletions
  1. 1 1
      command.go
  2. 1 1
      store/store.go
  3. 2 2
      store/watcher.go

+ 1 - 1
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)

+ 1 - 1
store/store.go

@@ -126,7 +126,7 @@ func CreateStore(max int) *Store {
 		},
 	}
 
-	s.watcher = createWatcherHub()
+	s.watcher = newWatcherHub()
 
 	return s
 }

+ 2 - 2
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)}
 }