Documentation ¶
Index ¶
- func AddUint64(ns ...uint64) (sum uint64, overflow bool, err error)
- func BytesToUint32(b []byte) uint32
- func BytesToUint64(b []byte) uint64
- func FileExists(path string) bool
- func IsValidURI(u string) bool
- func ReadJsonFile[T any](path string, res *T) (*T, error)
- func SafeAdd(a, b uint64) (uint64, bool)
- func SafeSub(a, b uint64) (uint64, bool)
- func ShuffleSliceCopy[T any](src []T) []T
- func TransformSlice[S ~[]E, E any, V any](s S, mapper func(E) V) []V
- func Uint32ToBytes(i uint32) []byte
- func Uint64ToBytes(i uint64) []byte
- func WriteJsonFile[T any](path string, obj *T) error
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUint64 ¶
AddUint64 adds a list of uint64s together, returning an error and a boolean indicator if the sum overflows uint64.
func BytesToUint32 ¶
func BytesToUint64 ¶
func FileExists ¶
func IsValidURI ¶
func ReadJsonFile ¶
func ShuffleSliceCopy ¶
func ShuffleSliceCopy[T any](src []T) []T
func TransformSlice ¶
TransformSlice processes input slice s by calling the mapper callback for each element and returning the slice of values returned by the callback.
Could be used for extracting single field values from slice of structs etc.
func Uint32ToBytes ¶
func Uint64ToBytes ¶
func WriteJsonFile ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.