summaryrefslogtreecommitdiff
path: root/luasnip_snippets/go.json
blob: 1a52ce5b8ecb46ee614af28aa5f177c36e090d99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
  "map": {
    "prefix": "map",
    "description": "Map type",
    "body": "map[${1:keytype}]${2:valtype}"
  },
  ":": {
    "prefix": ":",
    "description": "Variable declaration :=",
    "body": "${1:name} := ${0:value}"
  },
  "json": {
    "prefix": "json",
    "description": "JSON field",
    "body": "`json:\"${1:displayName}\"`"
  },
  "err": {
    "prefix": "err",
    "description": "Basic error handling",
    "body": [
      "if err != nil {",
      "\tlog.${1:Fatal}(err)",
      "\\}"
    ]
  }
}