controlflow

package
v1.44.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exception

type Exception struct {
	X interface{}
}

func Try

func Try(f func() (err error)) (e *Exception)

func (*Exception) Catch

func (e *Exception) Catch(f func(e *Exception))

type KeyedTable

type KeyedTable[T comparable] map[T]func() int // -1 break/complete

func (KeyedTable[T]) Sequence

func (t KeyedTable[T]) Sequence(keys ...T)

func (KeyedTable[T]) Switch

func (t KeyedTable[T]) Switch(primary, default_ T)

type MatchCase

type MatchCase struct {
	Match func() int // 0 no match, 1 match, -1 break
	Then  func() int
}

type MatchTable

type MatchTable []MatchCase

func (MatchTable) Match

func (t MatchTable) Match()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL