1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-25 01:06:39 +00:00

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