5 ms·
In Go if you use the return value of a function you must also assign the error to something, either a variable or explicitly ignore it by assigning it to _. It
by kisielk 14y ago
In Go if you use the return value of a function you must also assign the error to something, either a variable or explicitly ignore it by assigning it to _. It was designed this way specifically to avoid the problem of not checking error conditions in C code.
- osi 14y agoThis breaks down when the method you call has no return value other than an error. In that case it is easy to forget.