Documentation
¶
Index ¶
- func Must0(err error)
- func Must1[T any](v T, err error) T
- func Must2[T any, V any](t T, v V, err error) (T, V)
- func Must3[T any, V any, U any](t T, v V, u U, err error) (T, V, U)
- func Must4[T any, V any, U any, W any](t T, v V, u U, w W, err error) (T, V, U, W)
- func Must5[T any, V any, U any, W any, X any](t T, v V, u U, w W, x X, err error) (T, V, U, W, X)
- func Must6[T, V, U, W, X, Y any](t T, v V, u U, w W, x X, y Y, err error) (T, V, U, W, X, Y)
- func Must7[T, V, U, W, X, Y, Z any](t T, v V, u U, w W, x X, y Y, z Z, err error) (T, V, U, W, X, Y, Z)
- func Must8[T, V, U, W, X, Y, Z, A any](t T, v V, u U, w W, x X, y Y, z Z, a A, err error) (T, V, U, W, X, Y, Z, A)
- func Zero[T any]() T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Zero ¶ added in v0.0.10
func Zero[T any]() T
Zero returns the zero value for a given type T.
The zero value is the default value that variables of type T are initialized to when declared without an explicit initializer. For example:
- For numeric types (int, float, etc.), the zero value is 0
- For strings, the zero value is ""
- For pointers, interfaces, channels, maps, and slices, the zero value is nil
- For structs, the zero value has all fields set to their respective zero values
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.