Go Snippets
Functions, structs, interfaces, goroutines, error handling, tests and HTTP handlers.
Type a prefix and press Tab. 15 snippets.
| Language | Prefix | What it inserts |
|---|---|---|
| Go | main |
A main package |
| Go | fn |
A function |
| Go | meth |
A method |
| Go | st |
A struct |
| Go | iface |
An interface |
| Go | err |
if err != nil |
| Go | errw |
Wrap an error |
| Go | fr |
for range |
| Go | go |
A goroutine |
| Go | ch |
Make a channel |
| Go | sel |
A select |
| Go | test |
A test |
| Go | tt |
A table driven test |
| Go | hh |
An HTTP handler |
| Go | df |
defer |
This extension runs no code and asks for no permissions.