From ee60339b2dd4cb5b1c1f9a5b2401fff962ca5918 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Sat, 22 Apr 2023 10:40:23 +0100 Subject: [PATCH] Fix filename. --- file.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file.go b/file.go index f2f0220..869b49c 100644 --- a/file.go +++ b/file.go @@ -334,6 +334,9 @@ func splitDirAndName(path string) (dir, name string, err error) { return path, "", nil } dir, name = filepath.Split(path) + if dir == "" { + return "", name, nil + } _, err = os.Stat(dir) return dir, name, err }