Skip to content

Commit e77d240

Browse files
committed
Fix test functions name
1 parent 91990a8 commit e77d240

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

test/testdata/wastedassign.go

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func noUseParams(params string) int {
2727
return a
2828
}
2929

30-
func f(param int) int {
30+
func manyif(param int) int {
3131
println(param)
3232
useOutOfIf := 1212121 // ERROR "wasted assignment"
3333
ret := 0
@@ -82,30 +82,7 @@ func checkLoopTest() int {
8282
return hoge
8383
}
8484

85-
func r(param int) int {
86-
println(param)
87-
useOutOfIf := 1212121
88-
ret := 0
89-
if false {
90-
useOutOfIf = 200 // ERROR "reassigned, but never used afterwards"
91-
return 0
92-
} else if param == 100 {
93-
ret = useOutOfIf
94-
} else if param == 200 {
95-
useOutOfIf = 100 // ERROR "wasted assignment"
96-
useOutOfIf = 100
97-
useOutOfIf = p(useOutOfIf)
98-
useOutOfIf += 200 // ERROR "wasted assignment"
99-
}
100-
useOutOfIf = 12
101-
println(useOutOfIf)
102-
useOutOfIf = 192
103-
useOutOfIf += 100
104-
useOutOfIf += 200 // ERROR "reassigned, but never used afterwards"
105-
return ret
106-
}
107-
108-
func mugen() {
85+
func infinity() {
10986
var i int
11087
var hoge int
11188
for {
@@ -117,7 +94,7 @@ func mugen() {
11794
return
11895
}
11996

120-
func noMugen() {
97+
func infinity2() {
12198
var i int
12299
var hoge int
123100
for {

0 commit comments

Comments
 (0)