aboutsummaryrefslogtreecommitdiff
path: root/template/go/snip-max-slice.go
blob: 4a022ba6590947633e929bed08067bf86a3621ba (plain)
1
2
3
4
5
6
7
8
9
func max(a []{{_input_:type}}) {{_input_:type}} {
	m := a[0]
	for _, v := range a {
		if v > m {
			m = v
		}
	}
	return m
}