Documentation ¶
Index ¶
- func Must[T any](v T, err error) T
- func Must2[T any, U any](v T, u U, err error) (T, U)
- func MustLookup[T any](v T, ok bool) T
- func MustLookupOr[T any](def T, v T, ok bool) T
- func MustLookupOrNil[T any](v *T, ok bool) *T
- func MustLookupOrZero[T any](v T, ok bool) T
- func MustOr[T any](def T, v T, err error) T
- func MustOrNil[T any](v *T, err error) *T
- func MustOrZero[T any](v T, err error) T
- func OrNil[T any](_ T, err error) error
- func OrNil2[T any](_, _ T, err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Must ¶
Must is a utility function that ensures a value is not nil and returns it. If the error is not nil, it panics with the error message.
func MustLookup ¶
MustLookup is a utility function that ensures a value is not nil and returns it. If the error is not nil, it panics with the error message.
func MustLookupOr ¶
MustLookupOr is a utility function that ensures a value is not nil and returns it. If the error is not nil, it returns the default value.
func MustLookupOrNil ¶
MustLookupOrNil is a utility function that ensures a value is not nil and returns it. If the error is not nil, it returns nil.
func MustLookupOrZero ¶
MustLookupOrZero is a utility function that ensures a value is not nil and returns it. If the error is not nil, it returns a zero value.
func MustOr ¶
MustOr is a utility function that ensures a value is not nil and returns it. If the error is not nil, it returns the default value.
func MustOrNil ¶
MustOrNil is a utility function that ensures a value is not nil and returns it. If the error is not nil, it returns nil.
func MustOrZero ¶
MustOrZero is a utility function that ensures a value is not nil and returns it. If the error is not nil, it returns a zero value.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package maps implements the functions, types, and interfaces for the module.
|
Package maps implements the functions, types, and interfaces for the module. |
Package settings implements the functions, types, and interfaces for the module.
|
Package settings implements the functions, types, and interfaces for the module. |
Package thread provides a simple way to run functions in goroutines with error handling.
|
Package thread provides a simple way to run functions in goroutines with error handling. |
Package trans implements the functions, types, and interfaces for the module.
|
Package trans implements the functions, types, and interfaces for the module. |
Package types implements the functions, types, and interfaces for the module.
|
Package types implements the functions, types, and interfaces for the module. |