oqtane-general-description #62

Merged
Kocoder merged 17 commits from oqtane-general-description into main 2026-03-02 11:33:12 +00:00
Showing only changes of commit ee667a1df7 - Show all commits

View File

@@ -60,12 +60,7 @@ func main() {
continue
}
count, err := countWordsInFile(content)
if err != nil {
fmt.Printf("Error getting review for %s: %v\n", file.Filename, err)
continue
}
count := countWords(content)
counts = append(counts, fmt.Sprintf("#### Review for `%s`\n\n%s", file.Filename, count))
}
@@ -97,21 +92,6 @@ func readFile(path string) (string, error) {
return string(content), nil
}
func countWordsInFile(path string) (int, error) {
file, err := os.Open(path)
if err != nil {
return 0, err
}
defer file.Close()
content, err := io.ReadAll(file)
if err != nil {
return 0, err
}
return countWords(string(content)), nil
}
func countWords(text string) int {
return len(strings.Fields(text))
}