(path string)
| 22 | }) |
| 23 | |
| 24 | func walkDirAndCountCommand(path string) int { |
| 25 | cmdCount := 0 |
| 26 | |
| 27 | filepath.Walk(path, func(p string, info os.FileInfo, err error) error { |
| 28 | if err != nil { |
| 29 | fmt.Println("Error walking commands directories:", err) |
| 30 | return err |
| 31 | } |
| 32 | |
| 33 | dir := filepath.Dir(p) |
| 34 | |
| 35 | if !info.IsDir() && !strings.HasSuffix(dir, "fakes") { |
| 36 | if strings.HasSuffix(info.Name(), ".go") && !strings.HasSuffix(info.Name(), "_test.go") { |
| 37 | cmdCount += 1 |
| 38 | } |
| 39 | } |
| 40 | return nil |
| 41 | }) |
| 42 | |
| 43 | return cmdCount |
| 44 | } |
no test coverage detected