tenv icon indicating copy to clipboard operation
tenv copied to clipboard

tenv detects environment variable not using t.Setenv

Results 4 tenv issues
Sort by recently updated
recently updated
newest added

This PR adds `-go` flag to specify Go version. This is needed for `golangci-lint` to skip running `tenv` if the Go version is lower than `1.17`. Because `T.Setenv` was added...

I added the following test [here](https://github.com/sivchari/tenv/blob/main/testdata/src/a/a_test.go), and no errors or issues are displayed: ``` func TestForLoop(t *testing.T) { testsetup() for i := 0; i < 3; i++ { os.Setenv("a", "b")...

Tenv doesn't report any issues in such code ```go func TestLoadConfig(t *testing.T) { require.NoError(t, os.Setenv("a", "b")) } ``` I'd expect it to suggest using `t.Setenv`. Is it the expected behavior...

I believe the linter fails on detecting `os.Setenv` calls in more advanced scenarios. Here's one: ```go func TestModelSuite(t *testing.T) { suite.Run(t, &MySuite{}) } func (s *MySuite) SetupTest() { // ......