common

package
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatMemoryUsage

func FormatMemoryUsage(b uint64) float64

formatMemoryUsage converts bytes to megabytes

func JoinBytes

func JoinBytes(bytes ...interface{}) []byte

JoinBytes is an easy way to join multiple values into a single []byte

func ToNumber

func ToNumber[T interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | uintptr | float64 | float32
}](val interface{}) T

toNumber converts multiple types to a number

accepts: int (and variants), string, []byte, byte, bool

func ToString

func ToString[T interface{ string | []byte }](val interface{}) T

toString converts multiple types to a string|[]byte

accepts: string, []byte, byte, int (and variants), [][]byte, []interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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