File tree Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,8 @@ _TOOLS_NOGO = [
103
103
"@org_golang_x_tools//go/analysis/passes/nilness:go_default_library" ,
104
104
"@org_golang_x_tools//go/analysis/passes/pkgfact:go_default_library" ,
105
105
"@org_golang_x_tools//go/analysis/passes/printf:go_default_library" ,
106
- "@org_golang_x_tools//go/analysis/passes/shadow:go_default_library" ,
106
+ # shadow analyzer is too noisy, see #4340
107
+ # "@org_golang_x_tools//go/analysis/passes/shadow:go_default_library",
107
108
"@org_golang_x_tools//go/analysis/passes/shift:go_default_library" ,
108
109
"@org_golang_x_tools//go/analysis/passes/sortslice:go_default_library" ,
109
110
"@org_golang_x_tools//go/analysis/passes/stdmethods:go_default_library" ,
Original file line number Diff line number Diff line change @@ -43,10 +43,10 @@ go_library(
43
43
-- lib.go --
44
44
package lib
45
45
46
- func shadowed () string {
46
+ func useless () string {
47
47
foo := "original"
48
48
if foo == "original" {
49
- foo := "shadow"
49
+ foo = foo
50
50
return foo
51
51
}
52
52
return foo
@@ -64,10 +64,10 @@ go_library(
64
64
-- go/lib.go --
65
65
package lib
66
66
67
- func shadowed () string {
67
+ func useless () string {
68
68
foo := "original"
69
69
if foo == "original" {
70
- foo := "shadow"
70
+ foo = foo
71
71
return foo
72
72
}
73
73
return foo
@@ -85,10 +85,10 @@ go_library(
85
85
-- go/third_party/lib.go --
86
86
package lib
87
87
88
- func shadowed () string {
88
+ func useless () string {
89
89
foo := "original"
90
90
if foo == "original" {
91
- foo := "shadow"
91
+ foo = foo
92
92
return foo
93
93
}
94
94
return foo
@@ -114,8 +114,8 @@ func TestNotIncluded(t *testing.T) {
114
114
func TestIncluded (t * testing.T ) {
115
115
if err := bazel_testing .RunBazel ("build" , "//go:lib" ); err == nil {
116
116
t .Fatal ("Expected build to fail" )
117
- } else if ! strings .Contains (err .Error (), "lib.go:6:3: declaration of \" foo\" shadows declaration at line 4 (shadow )" ) {
118
- t .Fatalf ("Expected error to contain \" lib.go:6:3: declaration of \" foo\" shadows declaration at line 4 (shadow )\" , got %s" , err )
117
+ } else if ! strings .Contains (err .Error (), "lib.go:6:3: self-assignment of foo to foo (assign )" ) {
118
+ t .Fatalf ("Expected error to contain \" lib.go:6:3: self-assignment of foo to foo (assign )\" , got %s" , err )
119
119
}
120
120
}
121
121
Original file line number Diff line number Diff line change @@ -45,10 +45,10 @@ go_library(
45
45
-- lib.go --
46
46
package lib
47
47
48
- func shadowed () string {
48
+ func useless () string {
49
49
foo := "original"
50
50
if foo == "original" {
51
- foo := "shadow"
51
+ foo = foo
52
52
return foo
53
53
}
54
54
return foo
@@ -66,10 +66,10 @@ go_library(
66
66
-- go/lib.go --
67
67
package lib
68
68
69
- func shadowed () string {
69
+ func useless () string {
70
70
foo := "original"
71
71
if foo == "original" {
72
- foo := "shadow"
72
+ foo = foo
73
73
return foo
74
74
}
75
75
return foo
@@ -87,10 +87,10 @@ go_library(
87
87
-- go/third_party/lib.go --
88
88
package lib
89
89
90
- func shadowed () string {
90
+ func useless () string {
91
91
foo := "original"
92
92
if foo == "original" {
93
- foo := "shadow"
93
+ foo = foo
94
94
return foo
95
95
}
96
96
return foo
@@ -108,8 +108,8 @@ func TestNotIncluded(t *testing.T) {
108
108
func TestIncluded (t * testing.T ) {
109
109
if err := bazel_testing .RunBazel ("build" , "//go:lib" ); err == nil {
110
110
t .Fatal ("Expected build to fail" )
111
- } else if ! strings .Contains (err .Error (), "lib.go:6:3: declaration of \" foo\" shadows declaration at line 4 (shadow )" ) {
112
- t .Fatalf ("Expected error to contain \" lib.go:6:3: declaration of \" foo\" shadows declaration at line 4 (shadow )\" , got %s" , err )
111
+ } else if ! strings .Contains (err .Error (), "lib.go:6:3: self-assignment of foo to foo (assign )" ) {
112
+ t .Fatalf ("Expected error to contain \" lib.go:6:3: self-assignment of foo to foo (assign )\" , got %s" , err )
113
113
}
114
114
}
115
115
You can’t perform that action at this time.
0 commit comments