|
|
|
|
|
by cyberroadie
5017 days ago
|
|
The author of the blog post is overlooking a major feature here. Go does multiple return types, so you can do things like this:
i, err := getValue()
however if you want to ignore a return variable or in this case the returned error you use an underscore like this (same as in haskell):
i, _ := getValue() This is Go's mechanism for handling (or ignoring errors) which imho is really nice because you don't have to learn anything extra, like throwing/catching error mechanisms |
|