https://github.com/doggy8088/go-extension-pack#readme
- Go Snippets
- code skeleton
pkgm
: package main and main functionhelloweb
: sample hello world webapp
- code patterns
sort
: customsort.Sort
interface implementation
- function/method
func
:function
declarationfmain
: main functionfinit
: init functiongo
: anonymousgoroutine
declaration
meth
:method
declaration
- imports
im
:import
statementims
:import
block
- declarations
var
:variable
declarationco
:constant
declarationcos
:constant
block declarationin
: emptyinterface
tyi
: typeinterface
declarationtys
: typestruct
declarationmap
:map
declarationgf
:goroutine
declaration
- statements
if
: if statementel
: else statementie
: if-else statementiferr
: if err != nilswitch
: switch statementcs
: case clause
for
: for statementforr
: for range statementsel
: select statementmake
: make statementnew
: new statementdf
: defer statementch
: channelpn
: panic
- fmt
fp
: fmt.Println()ff
: fmt.Printf()
- log
lp
: log.Println()lf
: log.Printf()lv
: log.Printf() with variable content
- net/http
hf
: http.HandleFunc()hand
: http handler declarationwr
: http Responserd
: http.Redirect()herr
: http.Error()
las
: http.ListenAndServe()sv
: http.Serve()
- testing
- function template
tdt
: table driven test functiontf
: Test functionbf
: Benchmark functionef
: Example function
- common api
tl
: t.Log()tlf
: t.Logf()tlv
: t.Logf() with variable content
- function template
- code skeleton