all repos — piggy @ 1a0ce761ef68d0800a69ebff7968d2c655aba6f3

Dead simple finance manager in Go, HTML and JS.

src/app/utils.go (view raw)

 1package app
 2
 3func IndexOf[T comparable](slice []T, element T) int {
 4	for i, el := range slice {
 5		if el == element {
 6			return i
 7		}
 8	}
 9	return -1
10}
11
12func (b Bookmaker) IsExchange() bool {
13	return b.DefaultCommission != 0
14}