Skip to content

Commit

Permalink
service/logs: Using the variable on range scope testcase in functio…
Browse files Browse the repository at this point in the history
…n literal (scopelint)

```
service/logs/parse_logs_test.go:26:35: Using the variable on range scope `testcase` in function literal (scopelint)
			actual, err := ParseLogDetails(testcase.line)
			                               ^
service/logs/parse_logs_test.go:27:7: Using the variable on range scope `testcase` in function literal (scopelint)
			if testcase.err != nil {
			   ^
service/logs/parse_logs_test.go:28:26: Using the variable on range scope `testcase` in function literal (scopelint)
				assert.Error(t, err, testcase.err.Error())
				                     ^
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Oct 31, 2019
1 parent 5a2a9d9 commit c828fa1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions service/logs/parse_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func TestParseLogDetails(t *testing.T) {
{"errors", nil, errors.New("invalid details format")},
}
for _, testcase := range testCases {
testcase := testcase
t.Run(testcase.line, func(t *testing.T) {
actual, err := ParseLogDetails(testcase.line)
if testcase.err != nil {
Expand Down

0 comments on commit c828fa1

Please sign in to comment.