Tweaked Go snippets

This commit is contained in:
afolmert 2011-06-24 10:09:28 +02:00
parent b086b2d467
commit efec3786f7

View File

@ -1,8 +1,11 @@
# append # append
snippet ap snippet ap
append(${1:slice}, ${2:value}) append(${1:slice}, ${2:value})
# bool
snippet bl
bool
# byte # byte
snippet b snippet bt
byte byte
# break # break
snippet br snippet br
@ -10,11 +13,15 @@ snippet br
# channel # channel
snippet ch snippet ch
chan ${1:int} chan ${1:int}
# const # case
snippet cs snippet cs
const ${1:NAME} = ${2:value} case ${1:value}:
${2:/* code */}
# const
snippet c
const ${1:NAME} = ${2:0}
# constants with iota # constants with iota
snippet cst snippet co
const ( const (
${1:NAME1} = iota ${1:NAME1} = iota
${2:NAME2} ${2:NAME2}
@ -86,14 +93,20 @@ snippet ir
} }
${1} ${1}
# false # false
snippet fa snippet f
false false
# fallthrough # fallthrough
snippet fth snippet ft
fallthrough fallthrough
# float # float
snippet fl snippet fl
float32 float32
# float32
snippet f3
float32
# float64
snippet f6
float64
# if else # if else
snippet ie snippet ie
if ${1:/* condition */} { if ${1:/* condition */} {
@ -151,7 +164,7 @@ snippet rt
snippet rs snippet rs
result result
# select # select
snippet sel snippet sl
select { select {
case ${1:v1} := <-${2:chan1} case ${1:v1} := <-${2:chan1}
${3:/* code */} ${3:/* code */}
@ -181,7 +194,7 @@ snippet sw
snippet sp snippet sp
fmt.Sprintf("${1:%s}", ${2:var})${3} fmt.Sprintf("${1:%s}", ${2:var})${3}
# true # true
snippet tr snippet t
true true
# variable declaration # variable declaration
snippet v snippet v