Closed pkwarren closed 7 months ago
In Go 1.22 (with GOEXPERIMENT=loopvar now the default), the Range statement for test <test> does not reinitialise the variable <var> linter is no longer accurate. If you take the example program linked from https://github.com/kunwardeep/paralleltest?tab=readme-ov-file#tparallel-is-called-in-the-range-method-and-test-case-variable-tc-being-used-but-is-not-reinitialised-more-info, you can see that it no longer reports incorrect output.
GOEXPERIMENT=loopvar
Range statement for test <test> does not reinitialise the variable <var>
Is it possible to omit these warnings when running on Go 1.22+ or allow a mechanism to ignore these warnings?
Hey @pkwarren, thanks for bringing this to my attention. Any chance you could submit a PR?
@kunwardeep I create a PR to add an option https://github.com/kunwardeep/paralleltest/pull/35
In Go 1.22 (with
GOEXPERIMENT=loopvar
now the default), theRange statement for test <test> does not reinitialise the variable <var>
linter is no longer accurate. If you take the example program linked from https://github.com/kunwardeep/paralleltest?tab=readme-ov-file#tparallel-is-called-in-the-range-method-and-test-case-variable-tc-being-used-but-is-not-reinitialised-more-info, you can see that it no longer reports incorrect output.Is it possible to omit these warnings when running on Go 1.22+ or allow a mechanism to ignore these warnings?