aboutsummaryrefslogtreecommitdiff
path: root/template/go/snip-abs.go
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-23 22:03:34 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-23 22:03:34 +0900
commite01b6d01f7b29be14fac83d0d10d1f364af97055 (patch)
tree6ec1691235c70e8959f59e3334e0e6bdb0a0d59c /template/go/snip-abs.go
parent7292342afd74b9cc812a727b12ce42626c7886ef (diff)
parent670b6a9aa93ca98e45c15ddd1a4590aabc4a635b (diff)
downloadvim-sonictemplate-e01b6d01f7b29be14fac83d0d10d1f364af97055.tar.gz
vim-sonictemplate-e01b6d01f7b29be14fac83d0d10d1f364af97055.tar.bz2
vim-sonictemplate-e01b6d01f7b29be14fac83d0d10d1f364af97055.zip
Merge branch 'master' of https://github.com/mattn/sonictemplate-vim
Diffstat (limited to 'template/go/snip-abs.go')
-rw-r--r--template/go/snip-abs.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/template/go/snip-abs.go b/template/go/snip-abs.go
new file mode 100644
index 0000000..63f75a2
--- /dev/null
+++ b/template/go/snip-abs.go
@@ -0,0 +1,6 @@
+func abs(v {{_input_:type}}) {{_input_:type}} {
+ if v < 0 {
+ return -v
+ }
+ return v
+}