Documentation ¶
Overview ¶
Package ch10 contains the solution to the exercises in chapter 10 of Learning Go, 2nd edition.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add[T Number](a, b T) T
Add is a function that takes in two numbers values and returns their sum. It follows the rules specified by https://www.mathsisfun.com/numbers/addition.html
Types ¶
type Number ¶
type Number interface { constraints.Integer | constraints.Float }
Click to show internal directories.
Click to hide internal directories.