Skip to content

Instantly share code, notes, and snippets.

@ryanc414
Last active October 4, 2021 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanc414/49db4af1bb19fb59b432dceab1fddef8 to your computer and use it in GitHub Desktop.
Save ryanc414/49db4af1bb19fb59b432dceab1fddef8 to your computer and use it in GitHub Desktop.
type MyLongTypeName struct{
...
}
func foo(x int, y string) (MyLongTypeName, error) {
if x == 42 {
return MyLongTypeName{}, errors.New("x cannot be the meaning of life")
}
if y == "" {
return MyLongTypeName{}, errors.New("y cannot be empty")
}
return MyLongTypeName{...}, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment