Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save petergtz/68eb8cec02f0eb68a93f794a84d7f456 to your computer and use it in GitHub Desktop.
Save petergtz/68eb8cec02f0eb68a93f794a84d7f456 to your computer and use it in GitHub Desktop.
Some Go code with new error handling
virtualGuestService := softlayerClient.GetSoftLayer_Virtual_Guest_Service() or_on_error e {
fail_with cli.NewExitError(e.Error(), 1)
}
server := cliContext.GlobalString("server")
port := cliContext.GlobalInt("port")
if server == "" {
fail_with cli.NewExitError("server not provided as input flag", 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment