Skip to content

Commit ecb3d45

Browse files
committed
fix conflict
1 parent 682dc62 commit ecb3d45

File tree

10 files changed

+11
-60
lines changed

10 files changed

+11
-60
lines changed

.golangci.example.yml

-2
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,6 @@ linters-settings:
628628
begin: true
629629

630630
tenv:
631-
# The following configurations enable checks prior to Go 1.17.
632-
force: false
633631
# The all option will run against all method in test file.
634632
# By default, only methods that take *testing.T, *testing.B, and testing.TB as arguments are checked.
635633
all: false

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ require (
6969
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c
7070
github.com/shirou/gopsutil/v3 v3.21.8
7171
github.com/sirupsen/logrus v1.8.1
72-
github.com/sivchari/tenv v1.1.6
72+
github.com/sivchari/tenv v1.2.6
7373
github.com/sonatard/noctx v0.0.1
7474
github.com/sourcegraph/go-diff v0.6.1
7575
github.com/spf13/cobra v1.2.1

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/linters_settings.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,7 @@ type ThelperSettings struct {
465465
}
466466

467467
type TenvSettings struct {
468-
Force bool `mapstructure:"force"`
469-
All bool `mapstructure:"all"`
468+
All bool `mapstructure:"all"`
470469
}
471470

472471
type UnparamSettings struct {

pkg/golinters/tenv.go

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ func NewTenv(settings *config.TenvSettings) *goanalysis.Linter {
1919
if settings != nil {
2020
cfg = map[string]map[string]interface{}{
2121
a.Name: {
22-
tenv.F: settings.Force,
2322
tenv.A: settings.All,
2423
},
2524
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
linters-settings:
22
tenv:
3-
force: true
43
all: true

test/testdata/configs/tenv_force.yml

-3
This file was deleted.

test/testdata/tenv_all_force_test.go renamed to test/testdata/tenv_all_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// args: -Etenv
2-
// config_path: testdata/configs/tenv_all_force.yml
2+
// config_path: testdata/configs/tenv_all.yml
33
package testdata
44

55
import (

test/testdata/tenv_force_test.go

-41
This file was deleted.

test/testdata/tenv_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ func setup() {
1919
}
2020

2121
func TestF(t *testing.T) {
22-
os.Setenv("a", "b") // OK
23-
if err := os.Setenv("a", "b"); err != nil { // OK
22+
os.Setenv("a", "b") // ERROR "func TestF is not using testing.Setenv"
23+
if err := os.Setenv("a", "b"); err != nil { // ERROR "func TestF is not using testing.Setenv"
2424
_ = err
2525
}
2626
}
2727

2828
func BenchmarkF(b *testing.B) {
29-
os.Setenv("a", "b") // OK
30-
if err := os.Setenv("a", "b"); err != nil { // OK
29+
os.Setenv("a", "b") // ERROR "func BenchmarkF is not using testing.Setenv"
30+
if err := os.Setenv("a", "b"); err != nil { // ERROR "func BenchmarkF is not using testing.Setenv"
3131
_ = err
3232
}
3333
}
3434

3535
func testTB(tb testing.TB) {
36-
os.Setenv("a", "b") // OK
37-
if err := os.Setenv("a", "b"); err != nil { // OK
36+
os.Setenv("a", "b") // ERROR "func testTB is not using testing.Setenv"
37+
if err := os.Setenv("a", "b"); err != nil { // ERROR "func testTB is not using testing.Setenv"
3838
_ = err
3939
}
4040
}

0 commit comments

Comments
 (0)