Skip to content

Commit

Permalink
chore: Use Go v1.22+ range syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Mar 11, 2024
1 parent 6d3cb3e commit 57866c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/template/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func run(cmd *cobra.Command, args []string) error {
}

var buf strings.Builder
for i := 0; i < conf.Count; i += 1 {
for range conf.Count {
if err := tmpl.Execute(&buf, nil); err != nil {
return fmt.Errorf("template error: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/wordlist/wordlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (w Wordlist) RandWord() string {

func (w Wordlist) RandWords(n int) []string {
result := make([]string, 0, n)
for i := 0; i < n; i += 1 {
for range n {
result = append(result, w.RandWord())
}
return result
Expand Down

0 comments on commit 57866c3

Please sign in to comment.