Created
July 15, 2022 14:19
-
-
Save nwillc/881310f27e6e496dda3e3920f3ae23af to your computer and use it in GitHub Desktop.
Go standard error pattern...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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