mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
feat(snippets): add various snippets for go-mode
This commit is contained in:
7
snippets/go-mode/ie
Normal file
7
snippets/go-mode/ie
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: if error
|
||||
# key: ife
|
||||
# --
|
||||
if err != nil {
|
||||
return ${0:err}
|
||||
}
|
||||
4
snippets/go-mode/lpd
Normal file
4
snippets/go-mode/lpd
Normal file
@@ -0,0 +1,4 @@
|
||||
# name: log.Printf("[DEBUG] ...\n", ...)
|
||||
# key: lpd
|
||||
# --
|
||||
log.Printf("[DEBUG] $1\n"$2)$0
|
||||
4
snippets/go-mode/lppd
Normal file
4
snippets/go-mode/lppd
Normal file
@@ -0,0 +1,4 @@
|
||||
# name: log.Printf("[DEBUG] ...: %+v\n", ...)
|
||||
# key: lppd
|
||||
# --
|
||||
log.Printf("[DEBUG] $1: %+v\n", $1)$0
|
||||
18
snippets/go-mode/tf
Normal file
18
snippets/go-mode/tf
Normal file
@@ -0,0 +1,18 @@
|
||||
# name: func TestName(t *testing.T) { tests := []struct{ ... } ... }
|
||||
# key: tf
|
||||
# --
|
||||
func Test${1:Name}(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
$0
|
||||
}{
|
||||
{
|
||||
name: "",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
11
snippets/go-mode/tt
Normal file
11
snippets/go-mode/tt
Normal file
@@ -0,0 +1,11 @@
|
||||
# name: tests := []struct{ ... }
|
||||
# key: tt
|
||||
# --
|
||||
tests := []struct {
|
||||
name string
|
||||
$0
|
||||
}{
|
||||
{
|
||||
name: "",
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user