Skip to content

Instantly share code, notes, and snippets.

@comtom
Last active September 27, 2018 17:45
Show Gist options
  • Select an option

  • Save comtom/04b229c6fbac639738a8f3c8dbe25ed9 to your computer and use it in GitHub Desktop.

Select an option

Save comtom/04b229c6fbac639738a8f3c8dbe25ed9 to your computer and use it in GitHub Desktop.
func f1(arg int) (int, error) {
if arg == 42 {
return -1, errors.New("can't work with 42")
}
return arg + 3, nil
}
if rresult, err := f1(i); err != nil {
fmt.Println("f1 failed:", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment