001: Error handling in Go episode artwork

EPISODE · Jan 10, 2022 · 16 MIN

001: Error handling in Go

from go podcast() · host Dominic St-Pierre

Wrapping error: fmt.Errorf("error trying to do X: %w", err)Package errors: https://pkg.go.dev/errorsExample of not using the happy path at 1st indentation:try {  if (user.HasAccessTo(Admin) {    if (somethingElse()) {      // happy path    }    else {}  }  else {}}catch(Exception ex) {  // what really happened, and where?}An   example of happy path in idiomatic Go:ok, error := hasAccessTo(user, ADMIN)if err != nil || !ok {  // handle not access}if !somethingElse() {  // handle something else false}// Happy pathMy course on building SaaS apps in Go.

Episode metadata supplied by the publisher feed · Published Jan 10, 2022

Embed this episode

I talk about error handling in Go, why I think it's good but after a little bit of time getting used to have error as values.

Distinct summary based on available episode metadata or transcript content.

Ready to play

001: Error handling in Go

0:00 16:44

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

No similar podcasts found.

Frequently Asked Questions

How long is this episode of go podcast()?

This episode is 16 minutes long.

When was this go podcast() episode published?

This episode was published on January 10, 2022.

Can I download this go podcast() episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!