Hacker News new | past | comments | ask | show | jobs | submit login

For unused vars you can do this and the compiler will ignore it.

_ = my_unsed_var;




Doesn't that entirely defeat the purpose of having the compiler not allow unused variables.


Add a pre-commit hook to forbid use of '_ ='.

   grep '$ *_ ?=' *


Not exactly. Because a quick grep of _ = gives you the variables which are needed to be checked before whether used or unused




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: