Просмотр исходного кода

chrod(watcher_hub) add comment to isHidden function

Xiang Li 12 лет назад
Родитель
Сommit
5851cb5b8d
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      store/watcher_hub.go

+ 2 - 0
store/watcher_hub.go

@@ -161,6 +161,8 @@ func (wh *watcherHub) clone() *watcherHub {
 // isHidden checks to see if key path is considered hidden to watch path i.e. the
 // last element is hidden or it's within a hidden directory
 func isHidden(watchPath, keyPath string) bool {
+	// if watch path is just a "/", after path will start without "/"
+	// add a "/" to deal with the special case when watchPath is "/"
 	afterPath := path.Clean("/" + keyPath[len(watchPath):])
 	return strings.Contains(afterPath, "/_")
 }