Skip to content

Commit

Permalink
build(linter): fix makezero linter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gen2thomas committed Jun 19, 2023
1 parent ad12eac commit 3b0f937
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ linters:
- zerologlint # not needed (related to zerolog package)
# important to have
- gofmt # important to prevent "format tsunami" ("gofmt -s -w" missed), disabled due to "https://github.com/golangci/golangci-lint-action/issues/535"
- makezero # very important (find/reduce bugs, e.g. in robot_work_test.go)
- nakedret # very useful together with "nonamedreturns" (reduce bugs)
- nonamedreturns # very useful (reduce bugs)
- unconvert # very useful (reduce bugs, simplify code)
Expand Down
6 changes: 4 additions & 2 deletions robot_work_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ func TestRobotAutomationFunctions(t *testing.T) {

func collectStringKeysFromWorkRegistry(rwr *RobotWorkRegistry) []string {
keys := make([]string, len(rwr.r))
for k := range rwr.r {
keys = append(keys, k)
var idx int
for key := range rwr.r {
keys[idx] = key
idx++
}
return keys
}

0 comments on commit 3b0f937

Please sign in to comment.