nvim/snippets/go.json

44 lines
662 B
JSON
Raw Normal View History

2024-01-14 23:20:45 +08:00
{
2024-01-22 20:23:18 +08:00
"class": {
"prefix": "class",
"body": "type $1 struct{$2}\n$0"
2024-01-26 15:32:49 +08:00
},
2024-01-27 12:31:15 +08:00
"errnil": {
"prefix": "errnil",
2024-01-26 15:32:49 +08:00
"body": [
"if err != nil {",
2024-01-27 12:31:15 +08:00
" $1",
2024-01-26 15:32:49 +08:00
"}"
]
2024-01-28 16:12:42 +08:00
},
"init": {
"prefix": "init",
"body": [
"func init() {",
" $1",
"}"
]
2024-02-07 13:34:06 +08:00
},
"ctx": {
"prefix": "ctx",
"body": [
"ctx := context.Background()"
]
2024-02-22 21:19:55 +08:00
},
"cok": {
"prefix": "cok",
"body": [
"c.JSON(http.StatusOK, vo.Success($1))"
]
},
"cbad": {
"prefix": "cbad",
"body": [
"if err != nil {",
" c.JSON(http.StatusBadRequest, vo.Fail(err))",
" return",
"}"
]
2024-01-22 20:23:18 +08:00
}
2024-01-14 23:20:45 +08:00
}