tree: Improve error for pre-existing node

This commit is contained in:
Alexander Neumann 2018-03-30 22:34:17 +02:00
parent baebf45e2e
commit cc847a3d6d

View file

@ -48,7 +48,7 @@ func (t Tree) Equals(other *Tree) bool {
func (t *Tree) Insert(node *Node) error {
pos, _, err := t.binarySearch(node.Name)
if err == nil {
return errors.New("node already present")
return errors.Errorf("node %q already present", node.Name)
}
// https://code.google.com/p/go-wiki/wiki/SliceTricks