Documentation
¶
Index ¶
- func IdentityFunc[T any]() func(T) T
- func IgnoreError(fn func() error)
- func IgnoreErrorWithOneArg[T any](fn func(t T) error, t T)
- func IsNil[T any](value T) bool
- type Hashable
- type Hasher
- func (h *Hasher) AddBool(b bool) (int, error)
- func (h *Hasher) AddBytes(b []byte) error
- func (h *Hasher) AddFloat64(f float64) error
- func (h *Hasher) AddG1s(generators []*math.G1) error
- func (h *Hasher) AddInt(i int) error
- func (h *Hasher) AddInt32(i int32) error
- func (h *Hasher) AddString(s string) error
- func (h *Hasher) AddUInt64(i uint64) error
- func (h *Hasher) Digest() []byte
- func (h *Hasher) HexDigest() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IdentityFunc ¶
func IdentityFunc[T any]() func(T) T
func IgnoreError ¶ added in v0.5.0
func IgnoreError(fn func() error)
IgnoreError runs a function that returns an error and silently ignores the error. It is intended to be used when the error from a cleanup operation (e.g., Close) is non-critical and can be safely discarded.
Example:
defer IgnoreError(file.Close)
func IgnoreErrorWithOneArg ¶ added in v0.5.0
Types ¶
type Hasher ¶ added in v0.5.0
type Hasher struct {
// contains filtered or unexported fields
}
func NewSHA256Hasher ¶ added in v0.5.0
func NewSHA256Hasher() *Hasher
func (*Hasher) AddFloat64 ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.