Bump wastedassign to v1.0.0 (#1955)

This commit is contained in:
Kensei Nakada 2021-05-05 20:22:48 +09:00 committed by GitHub
parent 96a7f62b2e
commit c213e4ed71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 17 deletions

View file

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