Documentation ¶
Index ¶
- Variables
- func ArrayBasics()
- func BlankSwitch()
- func ConcatTo[S fmt.Stringer, P Plusser](s []S, p []P) []string
- func CustomErrors()
- func DemoArraysAndSlices()
- func DemoConcatTo()
- func DemoControlStructures()
- func DemoErrors()
- func DemoGenerics()
- func DemoGoRoutines()
- func DemoMaps()
- func DemoStringify()
- func DemoStructs()
- func DemoSumIntsOrFloats()
- func ErrorWithStackTrace()
- func ErrorWrapChain()
- func Errorf(format string, args ...interface{}) error
- func JoinUnwrap()
- func MapAsSet()
- func MapBasics()
- func MapCommaOkIdiom()
- func SelectDemo()
- func SliceAppends()
- func SliceBasics()
- func SliceCopying()
- func SliceExpressions()
- func SliceLenCap()
- func SliceOverlapping()
- func SliceViaMake()
- func SquareJob()
- func Stringify[T fmt.Stringer](s []T) (ret []string)
- func StructConversions()
- func SumNumbers[K comparable, V Number](m map[K]V) V
- func Switch()
- type Animal
- type ListElement
- type ListHead
- type Number
- type Plusser
- type Status
- type StatusErr
Constants ¶
This section is empty.
Variables ¶
View Source
var ModulePath = "github.com/lenkite/learn/golrn"
Functions ¶
func ArrayBasics ¶
func ArrayBasics()
func BlankSwitch ¶
func BlankSwitch()
func ConcatTo ¶
ConcatTo takes a slice of elements with a String method and a slice of elements with a Plus method. The slices should have the same number of elements. This will convert each element of s to a string, pass it to the Plus method of the corresponding element of p, and return a slice of the resulting strings.
func CustomErrors ¶
func CustomErrors()
func DemoArraysAndSlices ¶
func DemoArraysAndSlices()
func DemoConcatTo ¶
func DemoConcatTo()
func DemoControlStructures ¶
func DemoControlStructures()
func DemoErrors ¶
func DemoErrors()
func DemoGenerics ¶
func DemoGenerics()
func DemoGoRoutines ¶
func DemoGoRoutines()
func DemoStringify ¶
func DemoStringify()
func DemoStructs ¶
func DemoStructs()
func DemoSumIntsOrFloats ¶
func DemoSumIntsOrFloats()
func ErrorWithStackTrace ¶
func ErrorWithStackTrace()
func ErrorWrapChain ¶
func ErrorWrapChain()
func JoinUnwrap ¶
func JoinUnwrap()
func MapCommaOkIdiom ¶
func MapCommaOkIdiom()
func SelectDemo ¶
func SelectDemo()
func SliceAppends ¶
func SliceAppends()
func SliceBasics ¶
func SliceBasics()
func SliceCopying ¶
func SliceCopying()
func SliceExpressions ¶
func SliceExpressions()
func SliceLenCap ¶
func SliceLenCap()
func SliceOverlapping ¶
func SliceOverlapping()
func SliceViaMake ¶
func SliceViaMake()
func StructConversions ¶
func StructConversions()
func SumNumbers ¶
func SumNumbers[K comparable, V Number](m map[K]V) V
SumNumbers sums the values of map m. It supports both int64 and float64 as types for map values.
Types ¶
type ListElement ¶
ListElement is an element in a linked list with a head. Each element points back to the head.
Click to show internal directories.
Click to hide internal directories.