Closed benma closed 7 years ago
package main import "fmt" func main() { var i int i = 3 i = 5 fmt.Println(i) }
$ ineffassign main.go does not produce any results. It should catch that the i = 3 assignment was ineffective (its value was never used).
$ ineffassign main.go
i = 3
I created the issue because I discovered an unchecked error in my code because of this pattern, i.e.:
err := someCall() err = anotherCall() if err != nil { ... }
Thanks for pointing this out! I'll work up a fix.
Excellent, thank you!
$ ineffassign main.go
does not produce any results. It should catch that thei = 3
assignment was ineffective (its value was never used).I created the issue because I discovered an unchecked error in my code because of this pattern, i.e.: