aboutsummaryrefslogtreecommitdiff
path: root/snippets.json
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2021-03-22 02:27:33 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2021-03-22 02:27:33 +0300
commitff66c26ad4cf74524daa7696a1ec2bcd0bde7d9b (patch)
tree6fd8ebedd25b15389e999b6619bc1f5cc86f68de /snippets.json
parent7707ba49f6471478f95a3bd40d9992b051321c7a (diff)
v0.0.2
Diffstat (limited to 'snippets.json')
-rw-r--r--snippets.json65
1 files changed, 0 insertions, 65 deletions
diff --git a/snippets.json b/snippets.json
deleted file mode 100644
index 294d806..0000000
--- a/snippets.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "Interface declaration": {
- "body": [
- "type $1 interface {",
- "\t$0",
- "}"
- ],
- "description": "go interface type",
- "prefix": "tyi"
- },
- "Package line": {
- "body": [
- "package ${TM_DIRECTORY/.+\\/(.+)$/${1:/downcase}/}",
- "",
- "$0"
- ],
- "description": "package header",
- "prefix": "pkg"
- },
- "Stack from array": {
- "body": [
- "type ${1:name} []${2:type}",
- "",
- "func (s *$1) Push(item $2) {",
- "\t*s = append(*s, item)",
- "}",
- "",
- "func (s *$1) Pop() (item $2) {",
- "\tif len(*s) == 0 {",
- "\t\treturn",
- "\t}",
- "",
- "\t*s, item = (*s)[:len(*s)-1], (*s)[len(*s)-1]",
- "\treturn item",
- "}"
- ],
- "description": "stack from array type",
- "prefix": "stack"
- },
- "Structure constructor": {
- "body": [
- "// New instance of $1 type.",
- "func New${1:type}(${2}) *$1 {",
- "\t$3",
- "\treturn &$1{$4}",
- "}"
- ],
- "description": "constructor for structure type",
- "prefix": "construct"
- },
- "Structure declaration": {
- "body": [
- "type $1 struct {",
- "\t$0",
- "}"
- ],
- "description": "strucutre type",
- "prefix": "tys"
- },
- "Variable declaration": {
- "body": "var $1 $2 = $3",
- "description": "variable with type and value",
- "prefix": "var"
- }
-}