chore: remove unused Go snippets
This commit is contained in:
parent
e70fc81e8e
commit
ea028589f8
1 changed files with 3 additions and 29 deletions
|
|
@ -8,10 +8,6 @@ local i = ls.insert_node
|
|||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
|
||||
ls.add_snippets("go", {
|
||||
s("fmt.debug", fmt('fmt.Println("[DEBUG] {}", {})', { i(1), i(2) })),
|
||||
s("fmt.info", fmt('fmt.Println("[INFO] {}")', { i(1) })),
|
||||
s("fmt.error", fmt('fmt.Println("[ERROR] {}", {})', { i(1), i(2) })),
|
||||
|
||||
s("if err", fmt([[
|
||||
if err != nil {{
|
||||
{}
|
||||
|
|
@ -19,45 +15,23 @@ ls.add_snippets("go", {
|
|||
}}
|
||||
]], { i(1), i(2) })),
|
||||
|
||||
s("fori", fmt([[
|
||||
s("for", fmt([[
|
||||
for i := range {} {{
|
||||
{}
|
||||
}}
|
||||
]], { i(1), i(2), })),
|
||||
|
||||
s("if", fmt([[
|
||||
if {} {{
|
||||
{}
|
||||
}}
|
||||
]], { i(1), i(2) })),
|
||||
|
||||
s("switch", fmt([[
|
||||
switch {} {{
|
||||
case {}:
|
||||
{}
|
||||
default:
|
||||
{}
|
||||
}}
|
||||
]], { i(1), i(2), i(3), i(4) })),
|
||||
|
||||
|
||||
s("jsonunmarshal", fmt([[
|
||||
s("unmarshal", fmt([[
|
||||
var {var_name} {}
|
||||
if err := json.Unmarshal({}, &{var_name}); err != nil {{
|
||||
return err
|
||||
}}
|
||||
]], { var_name = i(1), i(2), i(3) }, { repeat_duplicates = true })),
|
||||
|
||||
s("jsondecode", fmt([[
|
||||
s("decode", fmt([[
|
||||
var {var_name} {}
|
||||
if err := json.NewDecoder({}).Decode(&{var_name}); err != nil {{
|
||||
return err
|
||||
}}
|
||||
]], { var_name = i(1), i(2), i(3) }, { repeat_duplicates = true })),
|
||||
|
||||
s("func", fmt([[
|
||||
func {}({}) {} {{
|
||||
{}
|
||||
}}
|
||||
]], { i(1), i(2), i(3), i(4) })),
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue