Skip to content

Commit 2f7db03

Browse files
committed
dep: update wastedassign v0.2.0
1 parent 507703b commit 2f7db03

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ require (
5757
github.com/polyfloyd/go-errorlint v0.0.0-20201127212506-19bd8db6546f
5858
github.com/ryancurrah/gomodguard v1.2.0
5959
github.com/ryanrolds/sqlclosecheck v0.3.0
60-
github.com/sanposhiho/wastedassign v0.1.3
60+
github.com/sanposhiho/wastedassign v0.2.0
6161
github.com/securego/gosec/v2 v2.6.1
6262
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c
6363
github.com/shirou/gopsutil/v3 v3.21.1

go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/testdata/wastedassign.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,28 @@ func noUseParamsNoError(params string) int {
2828

2929
func manyif(param int) int {
3030
println(param)
31-
useOutOfIf := 1212121 // ERROR "wasted assignment"
31+
useOutOfIf := 1212121 // ERROR "reassigned, but reassigned without using the value"
3232
ret := 0
3333
if false {
3434
useOutOfIf = 200 // ERROR "reassigned, but never used afterwards"
3535
return 0
3636
} else if param == 100 {
37-
useOutOfIf = 100 // ERROR "wasted assignment"
37+
useOutOfIf = 100 // ERROR "reassigned, but reassigned without using the value"
3838
useOutOfIf = 201
3939
useOutOfIf = p(useOutOfIf)
40-
useOutOfIf += 200 // ERROR "wasted assignment"
40+
useOutOfIf += 200 // ERROR "reassigned, but reassigned without using the value"
4141
} else {
4242
useOutOfIf = 100
4343
useOutOfIf += 100
4444
useOutOfIf = p(useOutOfIf)
45-
useOutOfIf += 200 // ERROR "wasted assignment"
45+
useOutOfIf += 200 // ERROR "reassigned, but reassigned without using the value"
4646
}
4747

4848
if false {
4949
useOutOfIf = 200 // ERROR "reassigned, but never used afterwards"
5050
return 0
5151
} else if param == 200 {
52-
useOutOfIf = 100 // ERROR "wasted assignment"
52+
useOutOfIf = 100 // ERROR "reassigned, but reassigned without using the value"
5353
useOutOfIf = 201
5454
useOutOfIf = p(useOutOfIf)
5555
useOutOfIf += 200

0 commit comments

Comments
 (0)