aboutsummaryrefslogtreecommitdiff
path: root/template/go/pattern.stpl
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-03-06 11:07:26 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-03-06 11:07:26 +0900
commita969567ded55bc8449c60bad2b24cf164ec2e1a8 (patch)
tree3823157820ba0926d939881981d563e16ac14ec9 /template/go/pattern.stpl
parent4db5f77e67e6945a1820499a54c1fcc5b1994a92 (diff)
downloadvim-sonictemplate-a969567ded55bc8449c60bad2b24cf164ec2e1a8.tar.gz
vim-sonictemplate-a969567ded55bc8449c60bad2b24cf164ec2e1a8.tar.bz2
vim-sonictemplate-a969567ded55bc8449c60bad2b24cf164ec2e1a8.zip
Add some postfix completion. Thanks: skanehira
Diffstat (limited to 'template/go/pattern.stpl')
-rw-r--r--template/go/pattern.stpl12
1 files changed, 12 insertions, 0 deletions
diff --git a/template/go/pattern.stpl b/template/go/pattern.stpl
index 26ac4c6..70c60e6 100644
--- a/template/go/pattern.stpl
+++ b/template/go/pattern.stpl
@@ -79,3 +79,15 @@
{{$1}} bool
{{_cursor_}}
+\(\S\+\)\.append$
+ {{$1}} = append({{$1}}, {{_cursor_}})
+
+\(\S\+\)\.jsondecode$
+ if err := json.NewDecoder({{$1}}).Decode({{_cursor_}}); err != nil {
+ return err
+ }
+
+\(\S\+\)\.jsonencode$
+ if err := json.NewEncoder({{$1}}).Encode({{_cursor_}}); err != nil {
+ return err
+ }