-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update checking target and execution condition
- Loading branch information
Showing
10 changed files
with
93 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
linters-settings: | ||
tenv: | ||
force: true | ||
all: true |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// args: -Etenv | ||
// config_path: testdata/configs/tenv_all_force.yml | ||
package testdata | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
) | ||
|
||
var ( | ||
e = os.Setenv("a", "b") // ERROR "variable e is not using testing.Setenv" | ||
) | ||
|
||
func setup() { | ||
os.Setenv("a", "b") // ERROR "func setup is not using testing.Setenv" | ||
err := os.Setenv("a", "b") // ERROR "func setup is not using testing.Setenv" | ||
if err != nil { | ||
_ = err | ||
} | ||
} | ||
|
||
func TestF(t *testing.T) { | ||
os.Setenv("a", "b") // ERROR "func TestF is not using testing.Setenv" | ||
if err := os.Setenv("a", "b"); err != nil { // ERROR "func TestF is not using testing.Setenv" | ||
_ = err | ||
} | ||
} | ||
|
||
func BenchmarkF(b *testing.B) { | ||
os.Setenv("a", "b") // ERROR "func BenchmarkF is not using testing.Setenv" | ||
if err := os.Setenv("a", "b"); err != nil { // ERROR "func BenchmarkF is not using testing.Setenv" | ||
_ = err | ||
} | ||
} | ||
|
||
func testTB(tb testing.TB) { | ||
os.Setenv("a", "b") // ERROR "func testTB is not using testing.Setenv" | ||
if err := os.Setenv("a", "b"); err != nil { // ERROR "func testTB is not using testing.Setenv" | ||
_ = err | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,40 @@ | ||
// args: -Etenv | ||
// config_path: testdata/configs/tenv.yml | ||
package testdata | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
) | ||
|
||
var ( | ||
e = os.Setenv("a", "b") // ERROR "variable e is not using t.Setenv" | ||
e = os.Setenv("a", "b") // OK | ||
) | ||
|
||
func setup() { | ||
os.Setenv("a", "b") // ERROR "func setup is not using t.Setenv" | ||
err := os.Setenv("a", "b") // ERROR "func setup is not using t.Setenv" | ||
os.Setenv("a", "b") // OK | ||
err := os.Setenv("a", "b") // OK | ||
if err != nil { | ||
_ = err | ||
} | ||
} | ||
|
||
func TestF() { | ||
os.Setenv("a", "b") // ERROR "func TestF is not using t.Setenv" | ||
if err := os.Setenv("a", "b"); err != nil { // ERROR "func TestF is not using t.Setenv" | ||
func TestF(t *testing.T) { | ||
os.Setenv("a", "b") // OK | ||
if err := os.Setenv("a", "b"); err != nil { // OK | ||
_ = err | ||
} | ||
} | ||
|
||
func BenchmarkF(b *testing.B) { | ||
os.Setenv("a", "b") // OK | ||
if err := os.Setenv("a", "b"); err != nil { // OK | ||
_ = err | ||
} | ||
} | ||
|
||
func testTB(tb testing.TB) { | ||
os.Setenv("a", "b") // OK | ||
if err := os.Setenv("a", "b"); err != nil { // OK | ||
_ = err | ||
} | ||
} |