aboutsummaryrefslogtreecommitdiff
path: root/template/go/snip-min-slice.go
diff options
context:
space:
mode:
Diffstat (limited to 'template/go/snip-min-slice.go')
-rw-r--r--template/go/snip-min-slice.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/template/go/snip-min-slice.go b/template/go/snip-min-slice.go
new file mode 100644
index 0000000..733bcdc
--- /dev/null
+++ b/template/go/snip-min-slice.go
@@ -0,0 +1,9 @@
+func min(a []{{_input_:type}}) {{_input_:type}} {
+ m := a[0]
+ for _, v := range a {
+ if v < m {
+ m = v
+ }
+ }
+ return m
+}