From 9eaee21a03bb765b5be3cd9e0298bebb7f124b90 Mon Sep 17 00:00:00 2001 From: songzhibin97 <49082129+songzhibin97@users.noreply.github.com> Date: Sun, 22 May 2022 09:47:14 +0800 Subject: [PATCH] Update path.go (#2023) --- cmd/kratos/internal/base/path.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/kratos/internal/base/path.go b/cmd/kratos/internal/base/path.go index dc0483b2f..f0a505cec 100644 --- a/cmd/kratos/internal/base/path.go +++ b/cmd/kratos/internal/base/path.go @@ -79,14 +79,14 @@ func copyDir(src, dst string, replaces, ignores []string) error { } srcfp := path.Join(src, fd.Name()) dstfp := path.Join(dst, fd.Name()) + var e error if fd.IsDir() { - if err = copyDir(srcfp, dstfp, replaces, ignores); err != nil { - return err - } + e = copyDir(srcfp, dstfp, replaces, ignores) } else { - if err = copyFile(srcfp, dstfp, replaces); err != nil { - return err - } + e = copyFile(srcfp, dstfp, replaces) + } + if e != nil { + return e } } return nil