From e3ee2b23db067f765411a207a9cc22055e5f09fe Mon Sep 17 00:00:00 2001 From: Haelnorr Date: Mon, 17 Mar 2025 22:55:28 +1100 Subject: [PATCH] updated snippets --- lua/haelnorr/snippets/go.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lua/haelnorr/snippets/go.lua b/lua/haelnorr/snippets/go.lua index f35cd35..e33f4f3 100644 --- a/lua/haelnorr/snippets/go.lua +++ b/lua/haelnorr/snippets/go.lua @@ -20,8 +20,8 @@ local default_values = { info.index = info.index + 1 return c(info.index, { - t(info.err_name), t(string.format('errors.Wrap(%s, "%s")', info.err_name, info.func_name)), + t(info.err_name), }) else return t("err") @@ -39,7 +39,7 @@ local default_values = { end] = function(text, info) info.index = info.index + 1 return c(info.index, { - t(text .. "{}"), + t("nil"), t(text), }) end, @@ -178,9 +178,14 @@ func Handle() http.Handler { { field = i(1, "Field"), type = i(2, "type"), - key = f(function(args) - return camel_to_snake(args[1][1]) - end, { 1 }), + key = c(3, { + f(function(args) + return camel_to_snake(args[1][1]) + end, { 1 }), + f(function(args) + return args[1][1]:lower() + end, { 1 }), + }), } ) ),