ineffassign icon indicating copy to clipboard operation
ineffassign copied to clipboard

Detect ineffectual assignments in Go code.

Results 12 ineffassign issues
Sort by recently updated
recently updated
newest added

Hi, it would be useful for debugging if ineffassign was versioned and one could get that version through `--version` flag. Right now it's hard to know what version of ineffassign...

This tightens the analysis which has become too lenient after fixing #22. A possibility of panic can only lead to named returns being read if there is a "defer" statement...

This PR brings the flag `-i "[;]"` for ignoring files or directories.

I have the following snippet from some code I've written, where I've marked what I believe is a false-positive in-line. The context here is retrying calls with an AWS SDK....

``` package main import ( "errors" "fmt" ) func decorateErr(errPtr *error) { *errPtr = fmt.Errorf("blah blah blah %v", *errPtr) } func sampleFunc() (err error) { defer decorateErr(&err) err = errors.New("this...

In the code below, (which is obviously simplified from a larger context) map `m` is created, then an optional code path accidentally shadows the map, adds to the (wrong) map,...

Greetings! We recently had some problematic code custom-generated, and noticed that generated files are always ignored by this. As largely just a proof-of-concept to kick off discussion, I hacked up...

This code intends to overwrite a function's return value, but ineffectually assigns to a local variable instead: ```go package main import ( "errors" "fmt" ) func main() { fmt.Println("Hello", ineffassignTest())...