Skip to main content

2 posts tagged with "go"

View All Tags

Return a Bool or an Error in Go?

· 3 min read

In Go, errors are returned instead of exceptions being thrown when something goes wrong. In other languages, you might use a boolean to indicate the success of an operation. This post captures some thoughts on when to return a boolean and when to return an error in Go.

Go Errors

· 2 min read

In Go, errors are returned as values. We can construct them in several ways.