44 lines
662 B
JSON
44 lines
662 B
JSON
{
|
|
"class": {
|
|
"prefix": "class",
|
|
"body": "type $1 struct{$2}\n$0"
|
|
},
|
|
"errnil": {
|
|
"prefix": "errnil",
|
|
"body": [
|
|
"if err != nil {",
|
|
" $1",
|
|
"}"
|
|
]
|
|
},
|
|
"init": {
|
|
"prefix": "init",
|
|
"body": [
|
|
"func init() {",
|
|
" $1",
|
|
"}"
|
|
]
|
|
},
|
|
"ctx": {
|
|
"prefix": "ctx",
|
|
"body": [
|
|
"ctx := context.Background()"
|
|
]
|
|
},
|
|
"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",
|
|
"}"
|
|
]
|
|
}
|
|
}
|