summary refs log tree commit diff
path: root/.vim/snippets/go.lua
blob: ee63158375a642e417290457b09228e97819fc32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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")'),
      }
    )
  ),
}