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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user