Look at usage of range #2

Closed
opened 2025-01-23 22:53:00 +01:00 by sacha · 1 comment
Owner

Background
It was only when implementing the flags (commandline parameters) that I noticed I've been using range wrong.

What I kept doing:

for key, _ := range someSlice {
  do_something(someSlice[key])
}

Instead of:

for _, value := range someSlice {
  do_something(value)
}

DoD

  • Go through the code and find all incorrect usage of range
  • Fix all instances of range when used incorrectly
**Background** It was only when implementing the flags (commandline parameters) that I noticed I've been using `range` wrong. What I kept doing: ``` for key, _ := range someSlice { do_something(someSlice[key]) } ``` Instead of: ``` for _, value := range someSlice { do_something(value) } ``` **DoD** - [x] Go through the code and find all incorrect usage of `range` - [x] Fix all instances of `range` when used incorrectly
sacha referenced this issue from a commit 2025-01-23 23:11:33 +01:00
Author
Owner

Issue has been solved with c9b05e7026.

Issue has been solved with c9b05e7026b855df307ba8e71f743bfb73a78af2.
sacha closed this issue 2025-01-23 23:13:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: golang/sudoku-funpark#2
No description provided.