chore: update go snippets
This commit is contained in:
parent
1415109e47
commit
6863f46796
1 changed files with 6 additions and 11 deletions
|
|
@ -12,23 +12,18 @@ ls.add_snippets("go", {
|
||||||
s("fmt.info", fmt('fmt.Println("[INFO] {}")', { i(1) })),
|
s("fmt.info", fmt('fmt.Println("[INFO] {}")', { i(1) })),
|
||||||
s("fmt.error", fmt('fmt.Println("[ERROR] {}", {})', { i(1), i(2) })),
|
s("fmt.error", fmt('fmt.Println("[ERROR] {}", {})', { i(1), i(2) })),
|
||||||
|
|
||||||
s("err", fmt([[
|
s("if err", fmt([[
|
||||||
if err != nil {{
|
if err != nil {{
|
||||||
|
{}
|
||||||
return {}
|
return {}
|
||||||
}}
|
}}
|
||||||
]], { i(1) })),
|
]], { i(1), i(2) })),
|
||||||
|
|
||||||
s("iferr", fmt([[
|
s("fori", fmt([[
|
||||||
if err := {}; err != nil {{
|
for i := range {} {{
|
||||||
return err
|
|
||||||
}}
|
|
||||||
]], { i(1) })),
|
|
||||||
|
|
||||||
s("for", fmt([[
|
|
||||||
for {}, {} := range {} {{
|
|
||||||
{}
|
{}
|
||||||
}}
|
}}
|
||||||
]], { i(1), i(2), i(3), i(4) })),
|
]], { i(1), i(2), })),
|
||||||
|
|
||||||
s("if", fmt([[
|
s("if", fmt([[
|
||||||
if {} {{
|
if {} {{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue