diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-03-06 11:07:26 +0900 |
---|---|---|
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-03-06 11:07:26 +0900 |
commit | a969567ded55bc8449c60bad2b24cf164ec2e1a8 (patch) | |
tree | 3823157820ba0926d939881981d563e16ac14ec9 /template/go/pattern.stpl | |
parent | 4db5f77e67e6945a1820499a54c1fcc5b1994a92 (diff) | |
download | vim-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.stpl | 12 |
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 + } |