1
0
mirror of https://github.com/go-kratos/kratos.git synced 2026-05-22 10:15:24 +02:00

fix(cmd/kratos): filepath walk nil pointer reference problem (#1762)

* fix(cmd/kratos): filepath walk nil pointer reference problem

* Update path.go
This commit is contained in:
包子
2022-01-12 21:13:42 +08:00
committed by GitHub
parent 0ed2e0f379
commit a0006677e9
+1 -1
View File
@@ -103,7 +103,7 @@ func hasSets(name string, sets []string) bool {
func Tree(path string, dir string) {
_ = filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
if !info.IsDir() {
if err == nil && info != nil && !info.IsDir() {
fmt.Printf("%s %s (%v bytes)\n", color.GreenString("CREATED"), strings.Replace(path, dir+"/", "", -1), info.Size())
}
return nil