3 ms·
This is true, you can drop all return values. However, a lot of functions return a value and an error. If you want to access the value, you need to assign the
by NateDad 12y ago
This is true, you can drop all return values. However, a lot of functions return a value and an error. If you want to access the value, you need to assign the error to something too. And if you don't then use that error, the compiler will complain about it.
For simply dropping all return values on the ground, there are linters that will complain for you: https://github.com/kisielk/errcheck https://github.com/kisielk/errcheck