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

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

* Update path.go
pull/1763/head
包子 3 years ago committed by GitHub
parent 0ed2e0f379
commit a0006677e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/kratos/internal/base/path.go

@ -103,7 +103,7 @@ func hasSets(name string, sets []string) bool {
func Tree(path string, dir string) { func Tree(path string, dir string) {
_ = filepath.Walk(path, func(path string, info os.FileInfo, err error) error { _ = 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()) fmt.Printf("%s %s (%v bytes)\n", color.GreenString("CREATED"), strings.Replace(path, dir+"/", "", -1), info.Size())
} }
return nil return nil

Loading…
Cancel
Save