Skip to content

Commit

Permalink
Fix all loopclosure linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
na-- committed Mar 31, 2023
1 parent c09919b commit 4b30bf4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/v1/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func TestNullMetricTypeJSON(t *testing.T) {
t.Parallel()

for mt, val := range values {
mt, val := mt, val
t.Run(val, func(t *testing.T) {
t.Parallel()

Expand All @@ -38,6 +39,7 @@ func TestNullMetricTypeJSON(t *testing.T) {
t.Parallel()

for mt, val := range values {
mt, val := mt, val
t.Run(val, func(t *testing.T) {
t.Parallel()

Expand All @@ -61,6 +63,7 @@ func TestNullValueTypeJSON(t *testing.T) {
t.Parallel()

for mt, val := range values {
mt, val := mt, val
t.Run(val, func(t *testing.T) {
t.Parallel()

Expand All @@ -74,6 +77,7 @@ func TestNullValueTypeJSON(t *testing.T) {
t.Parallel()

for mt, val := range values {
mt, val := mt, val
t.Run(val, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 2 additions & 0 deletions js/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ func TestNewBundle(t *testing.T) {
t.Run("TLSCipherSuites", func(t *testing.T) {
t.Parallel()
for suiteName, suiteID := range lib.SupportedTLSCipherSuites {
suiteName, suiteID := suiteName, suiteID
t.Run(suiteName, func(t *testing.T) {
t.Parallel()
script := `
Expand Down Expand Up @@ -674,6 +675,7 @@ func TestOpen(t *testing.T) {
logger := testutils.NewLogger(t)

for name, fsInit := range fss {
name, fsInit := name, fsInit
t.Run(name, func(t *testing.T) {
t.Parallel()
for _, tCase := range testCases {
Expand Down
3 changes: 3 additions & 0 deletions js/console_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,16 @@ func TestFileConsole(t *testing.T) {
preExistingText = "Prexisting file\n"
)
for name, level := range levels {
name, level := name, level
t.Run(name, func(t *testing.T) {
t.Parallel()
for args, result := range argsets {
args, result := args, result
t.Run(args, func(t *testing.T) {
t.Parallel()
// whether the file is existed before logging
for msg, deleteFile := range preExisting {
msg, deleteFile := msg, deleteFile
t.Run(msg, func(t *testing.T) {
t.Parallel()
f, err := ioutil.TempFile("", "")
Expand Down
1 change: 1 addition & 0 deletions metrics/thresholds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ func TestThresholdsRunAll(t *testing.T) {
}

for name, data := range testdata {
name, data := name, data
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 1 addition & 0 deletions output/influxdb/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestParseURL(t *testing.T) {
"?payload_size=a": {Config{}, "strconv.Atoi: parsing \"a\": invalid syntax"},
}
for str, data := range testdata {
str, data := str, data
t.Run(str, func(t *testing.T) {
t.Parallel()
config, err := ParseURL(str)
Expand Down

0 comments on commit 4b30bf4

Please sign in to comment.