code: func (tree *bareTree) add(path string) {
  	// if a node already exists under the same path, nothing left to do
  	if _, ok := tree.Items[path]; ok {
  		return
  	}
  
  	pos := strings.LastIndex(path, ".")
  
  	// now walk backwards through the node path to find the first branch which exists that
  	// this path extends and add us as a child
  	// until then, keep adding new intermediate branches
  	prevPos := len(path)
  	for pos != -1 {
  		branch := path[:pos]
  		prevNode := path[pos+1 : prevPos]
  		if n, ok := tree.Items[branch]; ok {
  			n.Children = append(n.Children, prevNode)
  			break
  		}
  
  		tree.Items[branch] = &Node{
  			Path:     branch,
  			Children: []string{prevNode},
  		}
  
  		prevPos = pos
  		pos = strings.LastIndex(branch, ".")
  	}
  
  	if pos == -1 {
  		// no existing branches found that match. need to add to the root node.
  		branch := path[:prevPos]
  		n := tree.Items[""]
  		n.Children = append(n.Children, branch)
  	}
  
  	// Add leaf node
  	tree.Items[path] = &Node{
  		Path: path,
  		Defs: []schema.MKey{},
  	}
  }
docs: // Add adds the series path,
  // creating the nodes for each branch and the leaf node
  // based on UnpartitionedMemoryIdx.add() but without all the stuff
  // we don't need