Return directly if name does not exist (#871)

This commit is contained in:
link 2023-02-07 21:58:01 +08:00 committed by GitHub
parent 7dedbafc8a
commit 3611ec7d09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -581,7 +581,7 @@ func ReadLine(lineNumber int, path string) string {
func NameAccumulation(name string, dir string) string { func NameAccumulation(name string, dir string) string {
path := filepath.Join(dir, name) path := filepath.Join(dir, name)
if _, err := os.Stat(path); os.IsNotExist(err) { if _, err := os.Stat(path); os.IsNotExist(err) {
return path return name
} }
base := name base := name
strings.Split(base, "_") strings.Split(base, "_")