Skip to content

Instantly share code, notes, and snippets.

@JamesHovious
Created September 20, 2021 11:50
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 JamesHovious/53cb0b361f1e97b239ee137ef13d40e9 to your computer and use it in GitHub Desktop.
Save JamesHovious/53cb0b361f1e97b239ee137ef13d40e9 to your computer and use it in GitHub Desktop.
Go Error Syntax Variations
if val, ok := data[“key”]; ok {
// the key/value in the map exists
}
if gz, err := zlib.NewReader(base64decoder); err != nil {
return err
}
if err := decoder.Decode(&t); err != nil {
return err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment