Comments (1)
Thanks for your report.
After exiting the loop, rest
is not used, so it seems to detect that the last assign is reassigned, but never used afterwards
.
Hmm, This seems to be a difficult problem, because the report made by wastedassign is not wrong.
It is true that rest
is reassigned in the loop, used in the loop... and then finally reassigned when exiting the loop is useless.
But for the user, there is no way to fix it...(i.e. to be a good linter wastedassign
should not report this)
I'll figure out how to deal with this problem.
from wastedassign.
Related Issues (20)
- 他の変数のStoreに用いられているときは使用されているとみなす HOT 1
- if-elseif文の対応が甘い HOT 3
- 連続ループがあると無限待ちになる気がする
- 関数の引数で取得した物を比較でしか使ってないと"reassigned, but never used afterwards"が出る HOT 2
- 無限に再帰してpanicするケースがある HOT 3
- Type-Switchしている箇所の動作が怪しい気がする HOT 4
- 報告する際に変数名も入れたい
- golangci-lintに対応したい HOT 3
- Report with variable name HOT 2
- false-positive: variable dependencies in for loop HOT 1
- False positive in loops HOT 2
- complex c style for loop false positive HOT 1
- Suspected false positive: operator assignment inside loop HOT 1
- False positive with switch and function call HOT 3
- support auto fix
- Ignore variable declaration if it's the zero value HOT 4
- Panic case HOT 5
- SSA and generics (go1.18) HOT 7
- Document difference to `ineffassign` linter?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wastedassign.