Documentation ¶
Index ¶
- func Compare[T constraints.Ordered](x, y T) int
- func Detach(ctx context.Context) context.Context
- func Err(errors ...error) error
- func GetStacktrace(all bool) string
- func IsSortedAndUnique[T Sortable[T]](s []T) bool
- func IsSortedAndUniqueByHash[T ~[]byte](s []T) bool
- func IsSortedAndUniqueOrdered[T constraints.Ordered](s []T) bool
- func IsSortedBytes[T ~[]byte](s []T) bool
- func RandomBytes(n int) []byte
- func Sort[T Sortable[T]](s []T)
- func SortByHash[T ~[]byte](s []T)
- func Zero[T any]() T
- func ZeroSlice[T any](s []T)
- type Atomic
- type Sortable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶ added in v1.10.18
func Compare[T constraints.Ordered](x, y T) int
Compare returns
-1 if x is less than y, 0 if x equals y, 1 if x is greater than y.
TODO: Remove after updating to go1.21.
func GetStacktrace ¶ added in v1.7.17
func IsSortedAndUnique ¶
Returns true iff the elements in [s] are unique and sorted.
func IsSortedAndUniqueByHash ¶ added in v1.9.4
Returns true iff the elements in [s] are unique and sorted based by their hashes.
func IsSortedAndUniqueOrdered ¶ added in v1.9.4
func IsSortedAndUniqueOrdered[T constraints.Ordered](s []T) bool
Returns true iff the elements in [s] are unique and sorted.
func IsSortedBytes ¶ added in v1.10.3
Returns true iff the elements in [s] are sorted.
func RandomBytes ¶ added in v1.3.2
RandomBytes returns a slice of n random bytes Intended for use in testing
func SortByHash ¶ added in v1.9.4
func SortByHash[T ~[]byte](s []T)
Sorts the elements of [s] based on their hashes.
Types ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
crypto
|
|
keychain
Package keychain is a generated GoMock package.
|
Package keychain is a generated GoMock package. |
Package filesystem is a generated GoMock package.
|
Package filesystem is a generated GoMock package. |
Package hashing is a generated GoMock package.
|
Package hashing is a generated GoMock package. |
Package resource is a generated GoMock package.
|
Package resource is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.