utils

package
v0.0.0-...-62718c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeError

func DescribeError(description string, err error) error

func FormatError

func FormatError(err error, format string, args ...interface{}) error

func Hash

func Hash(i interface{}) string

Hash returns the md5 hash token from any object

func PackFloatToBytes

func PackFloatToBytes(val float64) []byte

PackFloatToBytes returns a 8-byte slice containing the byte values of a float64.

func PackFloatToBytesInline

func PackFloatToBytesInline(val float64, ret []byte)

PackFloatToBytesInline fills ret with the byte values of the float64 argument. ret must be at least 8 bytes in size.

func PackU64ToBytes

func PackU64ToBytes(val uint64) []byte

PackU64ToBytes allocates a return value of appropriate length and fills it with the values of val.

func PackU64ToBytesInline

func PackU64ToBytesInline(val uint64, ret []byte)

PackU64ToBytesInline fills ret with the byte values of val. Ret must have length at least 8.

func UnpackBytesToFloat

func UnpackBytesToFloat(val []byte) float64

UnpackBytesToFloat converts a given byte slice into an equivalent float64.

func UnpackBytesToU64

func UnpackBytesToU64(val []byte) uint64

UnpackBytesToU64 converst a given byte slice into a uint64 value.

func WrapError

func WrapError(err error) error

Types

type GoTextError

type GoTextError struct {
	WrappedError error
	CurrentStack string
	Description  string
}

func (*GoTextError) Error

func (g *GoTextError) Error() string

Directories

Path Synopsis
Package gzipf provides a united interface around gzip and non-gzip files.
Package gzipf provides a united interface around gzip and non-gzip files.
Package jsonf provides convenience functions for saving and loading JSON-encoded values to and from the hard drive.
Package jsonf provides convenience functions for saving and loading JSON-encoded values to and from the hard drive.
Package xstrings is to provide string algorithms which are useful but not included in `strings` package.
Package xstrings is to provide string algorithms which are useful but not included in `strings` package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL