snippet scan abbr fmt.Scan fmt.Scan(&${1}) snippet of abbr os.OpenFile ${1:f}, err := os.OpenFile(${2:filename}, ${3:os.O_WRONLY}, 0666) if err != nil { panic(err) } defer $1.close() delete ife snippet ife options head if err != nil { return `g:NeosnippetSnippets_Goiferr()` } ${2} # json snippet snippet json abbr \`json:key\` \`json:"${1:`go#util#snippetcase(matchstr(getline("."), '\w\+'))`}"\` # yaml snippet snippet yaml abbr \`yaml:key\` \`yaml:"${1:`go#util#snippetcase(matchstr(getline("."), '\w\+'))`}"\` # http://stackoverflow.com/a/12518877 snippet fnex abbr if file not exists if _, err := os.Stat(${1:filename}); os.IsNotExist(err) { ${0:#:fmt.Printf("no such file or directory: %s", filename)} } snippet rand abbr rand.Seed rand.Seed(time.Now().UTC().UnixNano()) snippet forl abbr for list for e := l.Front(); e != nil; e = e.Next() { fmt.Println(e.Value) } # GoConvey snippets snippet Convey options head Convey("${1:Test Description}",${2: t,} func() { ${0} }) snippet ctx abbr ctx context.Context ctx context.Context snippet cb abbr context.Background() context.Background() snippet cc abbr context with cancel options head ctx, ${1:cancel} := context.WithCancel(${2:context.Background()}) defer $1() snippet ct abbr context with timeout options head ctx, ${1:cancel} := context.WithTimeout(${2:context.Background()}, ${3:timeout}) ${4:defer $1()} snippet suite abbr test suite with testify/suite options head type ${1:suiteName}Suite struct { suite.Suite } func Test${2:SuiteName}Suite(t *testing.T) { suite.Run(t, new($1Suite)) } func (s *$1Suite) SetupTest() { } func (s *$1Suite) TearDownTest() { } var ( _ suite.SetupTestSuite = (*$1Suite)(nil) _ suite.TearDownTestSuite = (*$1Suite)(nil) ) func (s *$1Suite) Test${3:Feature}() { } snippet judge abbr judgement day options head judgementDay := time.Date(1997, 8, 29, 0, 0, 0, 0, time.Local)