Skip to content

Commit

Permalink
clean up error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Banning committed Dec 19, 2016
1 parent b3f659e commit 78333d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rename.go
Expand Up @@ -9,10 +9,10 @@ import (
// It works only for nested maps. It doesn't work for cases when it buried in a list.
func (mv Map) RenameKey(path string, newName string) error {
if !mv.Exists(path) {
return errors.New("RenameKey: the path not found: " + path)
return errors.New("RenameKey: path not found: " + path)
}
if mv.Exists(parentPath(path) + "." + newName) {
return errors.New("RenameKey: the key already exists: " + newName)
return errors.New("RenameKey: key already exists: " + newName)
}

m := map[string]interface{}(mv)
Expand Down Expand Up @@ -50,5 +50,5 @@ func prevValueByPath(m interface{}, path string) (map[string]interface{}, error)
}
}
}
return nil, errors.New("prevValueByPath: didn't find the path – " + path)
return nil, errors.New("prevValueByPath: didn't find path – " + path)
}

0 comments on commit 78333d2

Please sign in to comment.