code: func newDir(name string, children []noder.Noder) (*dir, error) {
  	cloned := make([]noder.Noder, len(children))
  	_ = copy(cloned, children)
  	sort.Sort(byName(cloned))
  
  	if hasChildrenWithNoName(cloned) {
  		return nil, fmt.Errorf("non-root inner nodes cannot have empty names")
  	}
  
  	if hasDuplicatedNames(cloned) {
  		return nil, fmt.Errorf("children cannot have duplicated names")
  	}
  
  	return &dir{
  		name:     name,
  		children: cloned,
  	}, nil
  }
docs: // copies the children slice, so nobody can modify the order of its
  // elements from the outside.