From e4c8ff2f16006125cea0629b369f41ecbdab940a Mon Sep 17 00:00:00 2001 From: newbie Date: Thu, 22 Feb 2024 21:19:55 +0800 Subject: [PATCH] update --- snippets/go.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/snippets/go.json b/snippets/go.json index 206fcd8..79edb5b 100644 --- a/snippets/go.json +++ b/snippets/go.json @@ -24,5 +24,20 @@ "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", + "}" + ] } }