Skip to content

Commit e3b080f

Browse files
committed
Update golang snippets
1 parent 72d841f commit e3b080f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

neosnippets/go.snip

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,36 @@ options head
5656
${0:TARGET}
5757
}
5858

59+
snippet range
60+
abbr for range
61+
options head
62+
for ${1:v} := range ${2:#:iterator} {
63+
${0:TARGET}
64+
}
65+
5966
snippet if
6067
options head
6168
if ${1:err != nil} {
6269
${0:TARGET}
6370
}
6471

72+
snippet switch
73+
abbr switch {}
74+
options head
75+
switch ${1:#:v} {
76+
case ${2:#:condition}:
77+
${0:TARGET}
78+
}
79+
80+
snippet select
81+
abbr select {}
82+
options head
83+
select {
84+
case ${1:#:condition}:
85+
${0:TARGET}
86+
}
87+
88+
snippet case
89+
options head
90+
case ${1:#:condition}:
91+
${2:TARGET}

0 commit comments

Comments
 (0)