Skip to content

Instantly share code, notes, and snippets.

@juliofarah
Created March 13, 2020 19:17
Show Gist options
  • Save juliofarah/cd0c50d25966f8788d0bcf557f228b09 to your computer and use it in GitHub Desktop.
Save juliofarah/cd0c50d25966f8788d0bcf557f228b09 to your computer and use it in GitHub Desktop.
{
"Loop for each index": {
"prefix": "foreachi",
"body": [
"for i, $1 := range $2 {",
"}"
],
"description": "A for each loop with index"
},
"Loop for each": {
"prefix": "foreach",
"body": [
"for _, $1 := range $2 {",
"}"
],
"description": "A for each loop without index"
},
"Make array": {
"prefix": "makearray",
"body": [
"$1 := make([]$2, len($3))"
],
"description": "Make an array $1 of type $2 and length $3"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment