Documentation ¶
Index ¶
- func Pipe2[A any, B any, C any](a A, fa func(A) (B, error), fb func(B) (C, error)) (*C, error)
- func Pipe3[A any, B any, C any, D any](a A, fa func(A) (B, error), fb func(B) (C, error), fc func(C) (D, error)) (*D, error)
- func Pipe4[A any, B any, C any, D any, E any](a A, fa func(A) (B, error), fb func(B) (C, error), fc func(C) (D, error), ...) (*E, error)
- func Pipe5[A any, B any, C any, D any, E any, F any](a A, fa func(A) (B, error), fb func(B) (C, error), fc func(C) (D, error), ...) (*F, error)
- func SucceedOrCrash(e error)
- func ValOrCrash[V any](v V, e error) V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Pipe2 ¶
Sometimes you want to compose functions only if each call is successful, stopping if any return an error code. This is what the Pipe functions do. TODO: The Pipe functions seem like great candidates for code generation.
func ValOrCrash ¶
Return the given value if e is nil, otherwise log a fatal error and exit.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.