4 ms·
The good news is if you use Nix or Guix it’s relatively easy to hack your local build of the compiler to demote the unused variables hard error to just a warnin
by School-Cotton 2y ago
The good news is if you use Nix or Guix it’s relatively easy to hack your local build of the compiler to demote the unused variables hard error to just a warning.
- okwhateverdude 2y agoYou know, for some weird reason, it never crossed my mind to hack the Go compiler to let me do things like that. And it's such a great idea.
- deleted 2y ago[deleted]
- School-Cotton 2y agoThis patch is working for me. Good luck! https://gist.github.com/umanwizard/9793393083a42db933579fe21e9d367e https://gist.github.com/umanwizard/9793393083a42db933579fe21...
- Joker_vD 2y agoWell, it's about as easy without neither Nix not Guix.
- School-Cotton 2y agoIt's really not. Yes it's possible to figure out how to build and install the Go compiler, but then you have to repeat that process every time you want to upgrade to a new version. With Guix (I assume Nix is similar) you just save the patch somewhere and then run `guix install --with-patches=go=/path/to/patch go` and everything just works (including reapplying the patch on upgrade).