4 ms·
> Since Go makes errors a return value you have to actively discard the result (by replacing it with a underscore, e.g. `res, _ := getResults()`) or take the ti
by n_e 5y ago
> Since Go makes errors a return value you have to actively discard the result (by replacing it with a underscore, e.g. `res, _ := getResults()`) or take the time to handle the error.
LoadData(&data)
Does this function return nothing or an error ?
- cy_hauser 5y agoIt returns nothing or the compiler/linter/ide will tell you.
- tsimionescu 5y agoWhich compiler/linter/IDE is that? The Go compiler and linter certainly don't tell you: https://play.golang.org/p/k-eTs3dC_wK https://play.golang.org/p/k-eTs3dC_wK Note that Go playground also runs go vet, a static analysis tool.
- cy_hauser 5y agoYou're probably right. I use Goland and I just think of it as a natural extension to Go. I shouldn't.