use fmt pkg for Errorf call in create.go

Signed-off-by: James Sheppard <jgsheppa@protonmail.com>
pull/12063/head
James Sheppard 2 years ago
parent c26721fb0d
commit d102f8b422

@ -577,12 +577,12 @@ func Create(name, dir string) (string, error) {
if fi, err := os.Stat(path); err != nil {
return path, err
} else if !fi.IsDir() {
return path, errors.Errorf("no such directory %s", path)
return path, fmt.Errorf("no such directory %s", path)
}
cdir := filepath.Join(path, name)
if fi, err := os.Stat(cdir); err == nil && !fi.IsDir() {
return cdir, errors.Errorf("file %s already exists and is not a directory", cdir)
return cdir, fmt.Errorf("file %s already exists and is not a directory", cdir)
}
files := []struct {

Loading…
Cancel
Save