Documentation
¶
Index ¶
- func AssertEqual[T comparable](t *testing.T, got, want T)
- func AssertNotEqual[T comparable](t *testing.T, got, want T)
- func AssertTrue(t *testing.T, got bool)
- func BalanceFor(transactions []Transaction, name string) float64
- func Find[A any](items []A, predicate func(A) bool) (value A, found bool)
- func Reduce[A, B any](collection []A, accumulator func(B, A) B, initialValue B) B
- func Sum(numbers []int) int
- func SumAllTails(numbers ...[]int) []int
- type Account
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEqual ¶
func AssertEqual[T comparable](t *testing.T, got, want T)
func AssertNotEqual ¶
func AssertNotEqual[T comparable](t *testing.T, got, want T)
func AssertTrue ¶
func BalanceFor ¶
func BalanceFor(transactions []Transaction, name string) float64
func SumAllTails ¶
SumAllTails calculates the sums of all but the first number given a collection of slices.
Types ¶
type Account ¶
func NewBalanceFor ¶
func NewBalanceFor(account Account, transactions []Transaction) Account
type Transaction ¶
func NewTransaction ¶
func NewTransaction(from, to Account, sum float64) Transaction
Click to show internal directories.
Click to hide internal directories.