First commit.
This commit is contained in:
4
snippets/go-mode/append
Normal file
4
snippets/go-mode/append
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: append
|
||||
# --
|
||||
${1:type} = append($1, ${2:elems})
|
6
snippets/go-mode/coloneq
Normal file
6
snippets/go-mode/coloneq
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: ... := ...
|
||||
# key: :=
|
||||
# uuid: :=
|
||||
# --
|
||||
${1:x} := ${2:`%`}
|
5
snippets/go-mode/const
Normal file
5
snippets/go-mode/const
Normal file
@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Seong Yong-ju
|
||||
# name: const ... = ...
|
||||
# --
|
||||
const ${1:name}${2: type} = ${3:value}$0
|
4
snippets/go-mode/ctxc
Normal file
4
snippets/go-mode/ctxc
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: ctx context.Context
|
||||
# --
|
||||
ctx context.Context
|
6
snippets/go-mode/f
Normal file
6
snippets/go-mode/f
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func ...(...) ... { ... }
|
||||
# --
|
||||
func ${1:name}(${2:args})${3: return type} {
|
||||
`%`$0
|
||||
}
|
6
snippets/go-mode/fm
Normal file
6
snippets/go-mode/fm
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func (target) name(args) (results) { ... }
|
||||
# --
|
||||
func (${1:target}) ${2:name}(${3:args})${4: return type} {
|
||||
$0
|
||||
}
|
6
snippets/go-mode/for
Normal file
6
snippets/go-mode/for
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for ... { ... }
|
||||
# --
|
||||
for $1 {
|
||||
`%`$0
|
||||
}
|
6
snippets/go-mode/fore
Normal file
6
snippets/go-mode/fore
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for key, value := range ... { ... }
|
||||
# --
|
||||
for ${1:key}, ${2:value} := range ${3:target} {
|
||||
`%`$0
|
||||
}
|
6
snippets/go-mode/foreach
Normal file
6
snippets/go-mode/foreach
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for key, value := range ... { ... }
|
||||
# --
|
||||
for ${1:key}, ${2:value} := range ${3:target} {
|
||||
`%`$0
|
||||
}
|
6
snippets/go-mode/fori
Normal file
6
snippets/go-mode/fori
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for i := 0; i < n; i++ { ... }
|
||||
# --
|
||||
for ${1:i} := ${2:0}; $1 < ${3:10}; $1++ {
|
||||
`%`$0
|
||||
}
|
6
snippets/go-mode/forw
Normal file
6
snippets/go-mode/forw
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for ... { ... }
|
||||
# --
|
||||
for $1 {
|
||||
`%`$0
|
||||
}
|
6
snippets/go-mode/func
Normal file
6
snippets/go-mode/func
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func ...(...) ... { ... }
|
||||
# --
|
||||
func ${1:name}(${2:args})${3: return type} {
|
||||
`%`$0
|
||||
}
|
4
snippets/go-mode/go
Normal file
4
snippets/go-mode/go
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: go
|
||||
# --
|
||||
go ${1:func}(${2:args})$0
|
6
snippets/go-mode/gof
Normal file
6
snippets/go-mode/gof
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: go func
|
||||
# --
|
||||
go func (${1:args}) {
|
||||
$0
|
||||
}(${2:values})
|
6
snippets/go-mode/gofunc
Normal file
6
snippets/go-mode/gofunc
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: go func (short)
|
||||
# --
|
||||
go func (${1:args}) {
|
||||
$0
|
||||
}(${2:values})
|
7
snippets/go-mode/if
Normal file
7
snippets/go-mode/if
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Seong Yong-ju
|
||||
# name: if ... { ... }
|
||||
# --
|
||||
if ${1:condition} {
|
||||
`%`$0
|
||||
}
|
9
snippets/go-mode/ife
Normal file
9
snippets/go-mode/ife
Normal file
@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Seong Yong-ju
|
||||
# name: if ... { ... } else { ... }
|
||||
# --
|
||||
if ${1:condition} {
|
||||
`%`$2
|
||||
} else {
|
||||
$0
|
||||
}
|
6
snippets/go-mode/iferr
Normal file
6
snippets/go-mode/iferr
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: if err != nil { ... }
|
||||
# --
|
||||
if err != nil {
|
||||
`%`$0
|
||||
}
|
4
snippets/go-mode/imp
Normal file
4
snippets/go-mode/imp
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: import
|
||||
# --
|
||||
import ${1:package}$0
|
4
snippets/go-mode/import
Normal file
4
snippets/go-mode/import
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: import
|
||||
# --
|
||||
import ${1:package}$0
|
6
snippets/go-mode/interface
Normal file
6
snippets/go-mode/interface
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: type ... interface { ... }
|
||||
# --
|
||||
type $1 interface {
|
||||
`%`$0
|
||||
}
|
6
snippets/go-mode/main
Normal file
6
snippets/go-mode/main
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func main() { ... }
|
||||
# --
|
||||
func main() {
|
||||
$0
|
||||
}
|
4
snippets/go-mode/map
Normal file
4
snippets/go-mode/map
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: map
|
||||
# --
|
||||
map[${1:KeyType}]${2:ValueType}
|
6
snippets/go-mode/method
Normal file
6
snippets/go-mode/method
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func (target) name(args) (results) { ... }
|
||||
# --
|
||||
func (${1:target}) ${2:name}(${3:args})${4: return type} {
|
||||
$0
|
||||
}
|
4
snippets/go-mode/package
Normal file
4
snippets/go-mode/package
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: package
|
||||
# --
|
||||
package ${1:`(car (last (split-string (file-name-directory buffer-file-name) "/") 2))`}
|
4
snippets/go-mode/pkg
Normal file
4
snippets/go-mode/pkg
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: package (short)
|
||||
# --
|
||||
package ${1:`(car (last (split-string (file-name-directory buffer-file-name) "/") 2))`}
|
4
snippets/go-mode/pr
Normal file
4
snippets/go-mode/pr
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: printf
|
||||
# --
|
||||
fmt.Printf("$1\n"${2:, ${3:str}})
|
4
snippets/go-mode/printf
Normal file
4
snippets/go-mode/printf
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: printf
|
||||
# --
|
||||
fmt.Printf("$1\n"${2:, ${3:str}})
|
4
snippets/go-mode/println
Normal file
4
snippets/go-mode/println
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: println
|
||||
# --
|
||||
fmt.Println("${1:msg}")$0
|
4
snippets/go-mode/prln
Normal file
4
snippets/go-mode/prln
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: println (short)
|
||||
# --
|
||||
fmt.Println("${1:msg}")$0
|
7
snippets/go-mode/select
Normal file
7
snippets/go-mode/select
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: select
|
||||
# --
|
||||
select {
|
||||
case ${1:cond}:
|
||||
$0
|
||||
}
|
6
snippets/go-mode/struct
Normal file
6
snippets/go-mode/struct
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: type ... struct { ... }
|
||||
# --
|
||||
type $1 struct {
|
||||
`%`$0
|
||||
}
|
9
snippets/go-mode/switch
Normal file
9
snippets/go-mode/switch
Normal file
@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: switch
|
||||
# key: switch
|
||||
# uuid: switch
|
||||
# --
|
||||
switch {
|
||||
case ${1:cond}:
|
||||
$0
|
||||
}
|
6
snippets/go-mode/test
Normal file
6
snippets/go-mode/test
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: func Test...() { ... }
|
||||
# --
|
||||
func Test${1:Name}(${2:t *testing.T}) {
|
||||
`%`$0
|
||||
}
|
4
snippets/go-mode/var
Normal file
4
snippets/go-mode/var
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: var
|
||||
# --
|
||||
var ${1:name} ${2:type} = ${3:value}$0
|
6
snippets/go-mode/while
Normal file
6
snippets/go-mode/while
Normal file
@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name : for ... { ... }
|
||||
# --
|
||||
for $1 {
|
||||
`%`$0
|
||||
}
|
4
snippets/go-mode/wr
Normal file
4
snippets/go-mode/wr
Normal file
@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: http request writer
|
||||
# --
|
||||
w http.ResponseWriter, r *http.Request
|
Reference in New Issue
Block a user