Update wastedassign to v2.0.6 (#2020)

* Update: wastedassign to v2.0.5

* Update: wastedassign to v2.0.6
This commit is contained in:
Kensei Nakada 2021-05-29 20:26:26 +09:00 committed by GitHub
parent 7776b546b8
commit 2dcc761d21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 18 deletions

View file

@ -27,28 +27,28 @@ func noUseParams(params string) int {
func f(param int) int {
println(param)
useOutOfIf := 1212121 // ERROR "assigned, but reassigned without using the value"
useOutOfIf := 1212121 // ERROR "assigned to useOutOfIf, but reassigned without using the value"
ret := 0
if false {
useOutOfIf = 200 // ERROR "assigned, but never used afterwards"
useOutOfIf = 200 // ERROR "assigned to useOutOfIf, but never used afterwards"
return 0
} else if param == 100 {
useOutOfIf = 100 // ERROR "assigned, but reassigned without using the value"
useOutOfIf = 100 // ERROR "assigned to useOutOfIf, but reassigned without using the value"
useOutOfIf = 201
useOutOfIf = pa(useOutOfIf)
useOutOfIf += 200 // ERROR "assigned, but reassigned without using the value"
useOutOfIf += 200 // ERROR "assigned to useOutOfIf, but reassigned without using the value"
} else {
useOutOfIf = 100
useOutOfIf += 100
useOutOfIf = pa(useOutOfIf)
useOutOfIf += 200 // ERROR "assigned, but reassigned without using the value"
useOutOfIf += 200 // ERROR "assigned to useOutOfIf, but reassigned without using the value"
}
if false {
useOutOfIf = 200 // ERROR "assigned, but never used afterwards"
useOutOfIf = 200 // ERROR "assigned to useOutOfIf, but never used afterwards"
return 0
} else if param == 200 {
useOutOfIf = 100 // ERROR "assigned, but reassigned without using the value"
useOutOfIf = 100 // ERROR "assigned to useOutOfIf, but reassigned without using the value"
useOutOfIf = 201
useOutOfIf = pa(useOutOfIf)
useOutOfIf += 200
@ -62,7 +62,7 @@ func f(param int) int {
println(useOutOfIf)
useOutOfIf = 192
useOutOfIf += 100
useOutOfIf += 200 // ERROR "assigned, but never used afterwards"
useOutOfIf += 200 // ERROR "assigned to useOutOfIf, but never used afterwards"
return ret
}
@ -71,7 +71,7 @@ func checkLoopTest() int {
noUse := 1111
println(noUse)
noUse = 1111 // ERROR "assigned, but never used afterwards"
noUse = 1111 // ERROR "assigned to noUse, but never used afterwards"
for {
if hoge == 14 {
break
@ -86,21 +86,21 @@ func r(param int) int {
useOutOfIf := 1212121
ret := 0
if false {
useOutOfIf = 200 // ERROR "assigned, but never used afterwards"
useOutOfIf = 200 // ERROR "assigned to useOutOfIf, but never used afterwards"
return 0
} else if param == 100 {
ret = useOutOfIf
} else if param == 200 {
useOutOfIf = 100 // ERROR "assigned, but reassigned without using the value"
useOutOfIf = 100 // ERROR "assigned to useOutOfIf, but reassigned without using the value"
useOutOfIf = 100
useOutOfIf = pa(useOutOfIf)
useOutOfIf += 200 // ERROR "assigned, but reassigned without using the value"
useOutOfIf += 200 // ERROR "assigned to useOutOfIf, but reassigned without using the value"
}
useOutOfIf = 12
println(useOutOfIf)
useOutOfIf = 192
useOutOfIf += 100
useOutOfIf += 200 // ERROR "assigned, but never used afterwards"
useOutOfIf += 200 // ERROR "assigned to useOutOfIf, but never used afterwards"
return ret
}
@ -108,7 +108,7 @@ func mugen() {
var i int
var hoge int
for {
hoge = 5 // ERROR "assigned, but reassigned without using the value"
hoge = 5 // ERROR "assigned to hoge, but reassigned without using the value"
// break
}