summary refs log tree commit diff
path: root/.vim/snippets/go.lua
diff options
context:
space:
mode:
Diffstat (limited to '.vim/snippets/go.lua')
-rw-r--r--.vim/snippets/go.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/.vim/snippets/go.lua b/.vim/snippets/go.lua
new file mode 100644
index 0000000..ee63158
--- /dev/null
+++ b/.vim/snippets/go.lua
@@ -0,0 +1,28 @@
+return {
+  s({trig='package main', name='Go skeleton'},
+    fmt([[
+      package main
+
+      func main() {{
+      	{}
+      }}
+    ]], {i(0, 'println("hello world!")')})
+  ),
+  s({trig='package test', name='Go test skeleton'},
+    fmt([[
+      package main
+
+      import (
+      	"testing"
+      )
+
+      func Test{}(t *testing.T) {{
+      	{}
+      }}
+    ]], {
+        i(1, 'Foobar'),
+        i(0, 't.Logf("Hello world")'),
+      }
+    )
+  ),
+}