Skip to content

Instantly share code, notes, and snippets.

@martinsson
Last active October 4, 2020 22:36
Show Gist options
  • Save martinsson/3e3252d0f453ea7d4ee96df5bbd5df99 to your computer and use it in GitHub Desktop.
Save martinsson/3e3252d0f453ea7d4ee96df5bbd5df99 to your computer and use it in GitHub Desktop.
Error handling in go 3/3: the if statements have gone away. Finally!
tenantID, err1 := store.GetParameter("TENANT_ID")
clientID, err2 := store.GetParameter("CLIENT_ID")
clientSecret, err3 := store.GetParameter("CLIENT_SECRET")
globalErr := multierr.Combine(err1, err2, err3)
return connection{
tenantID,
clientID,
clientSecret,
}, globalErr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment