3 ms·
Go does not warn you if you forget to handle an error. It only does so if the function in question also returned a value that you're using. There exist importan
by pcwalton 9y ago
Go does not warn you if you forget to handle an error. It only does so if the function in question also returned a value that you're using. There exist important functions that don't return non-error values and report errors that you very much would like to avoid dropping on the floor: os.Chdir() for example.
- garfij 9y agoWhile this is technically true, I've considered `errcheck` to be standard tooling for what feels like forever now, and it does exactly this; make sure you're checking your errors.