Initial commit.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: benchmark
|
||||
# key: bench
|
||||
# contributor : @atotto
|
||||
# --
|
||||
func Benchmark$1(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
$0
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode:snippet -*-
|
||||
# name: const
|
||||
# key: const
|
||||
# --
|
||||
const ${1:name type} = ${2:val}
|
||||
$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode:snippet -*-
|
||||
# name: const (...)
|
||||
# key: const
|
||||
# --
|
||||
const (
|
||||
${1:name type} = ${2:val}
|
||||
)
|
6
.emacs.d/elpa/yasnippet-20160131.948/snippets/go-mode/dd
Normal file
6
.emacs.d/elpa/yasnippet-20160131.948/snippets/go-mode/dd
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: debug fmt.Printf
|
||||
# key: dd
|
||||
# --
|
||||
fmt.Printf("%+v\n", $1) // output for debug
|
||||
$0
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: default
|
||||
# key: def
|
||||
# --
|
||||
default:
|
||||
$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: else
|
||||
# key: el
|
||||
# --
|
||||
else {
|
||||
$0
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: error
|
||||
# key: err
|
||||
# contributor : @atotto
|
||||
# --
|
||||
if err != nil {
|
||||
$0
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: example
|
||||
# key: example
|
||||
# contributor : @atotto
|
||||
# --
|
||||
func Example$1() {
|
||||
$0
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode:snippet -*-
|
||||
# name: for
|
||||
# key: for
|
||||
# --
|
||||
for $1 {
|
||||
$0
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for range
|
||||
# key: range
|
||||
# contributor : @atotto
|
||||
# --
|
||||
for ${3:key}, ${2:value} := range ${1:target} {
|
||||
$0
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func
|
||||
# key: func
|
||||
# --
|
||||
// $1 ${4:...}
|
||||
func ${1:name}(${2:args}) $3 {
|
||||
$0
|
||||
}
|
7
.emacs.d/elpa/yasnippet-20160131.948/snippets/go-mode/if
Normal file
7
.emacs.d/elpa/yasnippet-20160131.948/snippets/go-mode/if
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: if
|
||||
# key: if
|
||||
# --
|
||||
if $1 {
|
||||
$0
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: if error
|
||||
# key: iferr
|
||||
# --
|
||||
if err != $1 {
|
||||
$0
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode:snippet -*-
|
||||
# name: import
|
||||
# key: imp
|
||||
# --
|
||||
import "$1"
|
||||
$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode:snippet -*-
|
||||
# name: import (...)
|
||||
# key: imp
|
||||
# --
|
||||
import (
|
||||
"$0"
|
||||
)
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: lambda func
|
||||
# key: lambda
|
||||
# --
|
||||
func(${1:args}) $2 {
|
||||
$0
|
||||
}()
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func main()
|
||||
# key: main
|
||||
# --
|
||||
func main() {
|
||||
$0
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: map
|
||||
# key: map
|
||||
# --
|
||||
map[${1:type}]${2:type}
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fmt.Printf(...)
|
||||
# key: pr
|
||||
# --
|
||||
fmt.Printf("${1:%s}\n", ${2:args})
|
||||
$0
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: select
|
||||
# key: sel
|
||||
# --
|
||||
select {
|
||||
case $1:
|
||||
$0
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: switch
|
||||
# key: sw
|
||||
# --
|
||||
switch $1 {
|
||||
case $2:
|
||||
$0
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: test
|
||||
# key: at
|
||||
# contributor : @atotto
|
||||
# --
|
||||
func Test$1(t *testing.T) {
|
||||
$0
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: testmain
|
||||
# key: testmain
|
||||
# contributor : @atotto
|
||||
# --
|
||||
func TestMain(m *testing.M) {
|
||||
setup()
|
||||
ret := m.Run()
|
||||
if ret == 0 {
|
||||
teardown()
|
||||
}
|
||||
os.Exit(ret)
|
||||
}
|
||||
|
||||
func setup() {
|
||||
$1
|
||||
}
|
||||
|
||||
func teardown() {
|
||||
$2
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: type
|
||||
# key: type
|
||||
# --
|
||||
type $1 $2 {
|
||||
$0
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: var
|
||||
# key: var
|
||||
# --
|
||||
var ${1:name} ${2:type}
|
||||
$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: var (...)
|
||||
# key: var
|
||||
# --
|
||||
var (
|
||||
${1:name} ${2:type}
|
||||
)
|
Reference in New Issue
Block a user