gordonklaus / ineffassign

Detect ineffectual assignments in Go code.
MIT License
390 stars 22 forks source link

Ignore generated files #49

Closed ericcornelissen closed 3 years ago

ericcornelissen commented 3 years ago

Closes #39, as per that thread I used Dmitri Shuralyov's "generated" package to detect if a .go file is generated. Currently, these files will always be generated. We could add a program flag that can be used to disable/enable ignoring generated file (I'm personally in favor of ignoring generated files by default and adding an option to not do so).

I did not create a unit test for this feature as I'm not sure how to adopt the current testing strategy for the new feature. Existing tests call checkPath() directly, but I added the functionality for this feature to walkPath().

gordonklaus commented 3 years ago

Thanks.