Sometimes I think it could be easier to just use the variable before its declared and then let the IDE auto fix create it, but I never remember to try it 😂
“oh, the line you are typing is incomplete and therefore the whole file is invalid which means there is nothing to suggest for autocomplete”
Compiler: you’re skating on thin ice there you fucking maverick
…and then there’s Go who just won’t let you compile at all
Go will not calm down! Go will NEVER calm down!
How DARE! YOU! suggest Go to calm down!?
Just enable format-on-save. That way gofmt can helpfully delete that variable you just added that you were for sure never going to use. You’re welcome!
What IDE is this?
It’s more language dependent than ide. Go for instance makes unused variables a compiler error (I believe) which means ides mark it as red immediately.
Ts/js can have eslint rules against unused variables but they will still usually compile or just run directly anyway.
Java doesnt error but can be set to warn you on them.
Abap doesn’t care and won’t tell you.
Your mileage will vary.