Skip to content

Instantly share code, notes, and snippets.

@nwillc
Created July 15, 2022 14:19
Show Gist options
  • Save nwillc/881310f27e6e496dda3e3920f3ae23af to your computer and use it in GitHub Desktop.
Save nwillc/881310f27e6e496dda3e3920f3ae23af to your computer and use it in GitHub Desktop.
Go standard error pattern...
func foo() (int, error) {...}
func fooBar() (string, error) {
value, err := foo()
if err != nil {
return 0, err
}
// ...
return fmt.Print(value), nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment