Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gordonklaus/ineffassign
Detect ineffectual assignments in Go code.
https://github.com/gordonklaus/ineffassign
Last synced: 3 months ago
JSON representation
Detect ineffectual assignments in Go code.
- Host: GitHub
- URL: https://github.com/gordonklaus/ineffassign
- Owner: gordonklaus
- License: mit
- Created: 2015-05-30T10:01:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-11-23T20:35:38.000Z (12 months ago)
- Last Synced: 2024-06-18T12:42:16.855Z (5 months ago)
- Language: Go
- Size: 53.7 KB
- Stars: 390
- Watchers: 5
- Forks: 22
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ineffassign
Detect ineffectual assignments in Go code. An assignment is ineffectual if the variable assigned is not thereafter used.
This tool misses some cases because it does not consider any type information in its analysis. For example, assignments to struct fields are never marked as ineffectual. It should, however, never give any false positives.
## Install
go install github.com/gordonklaus/ineffassign@latest
## Usage
For basic usage, run the following command from the root of your project:
ineffassign ./...
Which will analyze all packages beneath the current directory.
## Exit Codes
ineffassign returns 1 if any problems were found in the checked files. It returns 3 if there were any invalid arguments.