Browse Source

able to get root dir

Xiang Li 12 years ago
parent
commit
328b92e8e7
1 changed files with 5 additions and 0 deletions
  1. 5 0
      store/tree.go

+ 5 - 0
store/tree.go

@@ -124,6 +124,11 @@ func (t *tree) set(key string, value Node) bool {
 func (t *tree) internalGet(key string) (*treeNode, bool) {
 	nodesName := split(key)
 
+	// should be able to get root
+	if len(nodesName) == 1 && nodesName[0] == "" {
+		return t.Root, true
+	}
+
 	nodeMap := t.Root.NodeMap
 
 	var i int