Skip to content

Commit

Permalink
Tweaked Go snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
afolmert committed Jun 24, 2011
1 parent b086b2d commit efec378
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions snippets/go.snippets
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
# append
snippet ap
append(${1:slice}, ${2:value})
# bool
snippet bl
bool
# byte
snippet b
snippet bt
byte
# break
snippet br
break
# channel
snippet ch
chan ${1:int}
# const
# case
snippet cs
const ${1:NAME} = ${2:value}
case ${1:value}:
${2:/* code */}
# const
snippet c
const ${1:NAME} = ${2:0}
# constants with iota
snippet cst
snippet co
const (
${1:NAME1} = iota
${2:NAME2}
Expand Down Expand Up @@ -86,14 +93,20 @@ snippet ir
}
${1}
# false
snippet fa
snippet f
false
# fallthrough
snippet fth
snippet ft
fallthrough
# float
snippet fl
float32
# float32
snippet f3
float32
# float64
snippet f6
float64
# if else
snippet ie
if ${1:/* condition */} {
Expand Down Expand Up @@ -151,7 +164,7 @@ snippet rt
snippet rs
result
# select
snippet sel
snippet sl
select {
case ${1:v1} := <-${2:chan1}
${3:/* code */}
Expand Down Expand Up @@ -181,7 +194,7 @@ snippet sw
snippet sp
fmt.Sprintf("${1:%s}", ${2:var})${3}
# true
snippet tr
snippet t
true
# variable declaration
snippet v
Expand Down

0 comments on commit efec378

Please sign in to comment.