controlflow

package
v1.49.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All added in v1.46.0

func All(ops ...func() bool) (r bool)

func Checkerr added in v1.46.0

func Checkerr(err error)

func Either added in v1.46.0

func Either(ops ...func() bool) (r bool)

Types

type Exception

type Exception struct {
	X   interface{}
	Err error
}

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