Skip to content

Instantly share code, notes, and snippets.

@dvtkrlbs
Created October 7, 2025 07:34
Show Gist options
  • Select an option

  • Save dvtkrlbs/effbfbef1ffb419ea2d41fcf5c2d34fa to your computer and use it in GitHub Desktop.

Select an option

Save dvtkrlbs/effbfbef1ffb419ea2d41fcf5c2d34fa to your computer and use it in GitHub Desktop.
if err != nil snippet
{
// Each snippet must have a name and body, but the prefix and description are optional.
// The prefix is used to trigger the snippet, but when omitted then the name is used.
// Use placeholders like $1, $2 or ${1:defaultValue} to define tab stops.
// The $0 determines the final cursor position.
// Placeholders with the same value are linked.
"err check": {
"prefix": "err",
"body": ["if err != nil {", "$1", "}", "$0"],
"description": "Checks for error"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment