From 670b6a9aa93ca98e45c15ddd1a4590aabc4a635b Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Thu, 23 Jan 2020 12:16:30 +0900 Subject: Add some templates --- template/go/snip-abs.go | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 template/go/snip-abs.go (limited to 'template/go/snip-abs.go') 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 +} -- cgit v1.2.3-54-g00ecf