bytes

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteSize

func ByteSize(bytes uint64) string

ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth. The unit that results in the smallest number greater than or equal to 1 is always chosen.

func CopyBytes

func CopyBytes(b []byte) []byte

CopyBytes copies a slice to make it immutable

func CopyString

func CopyString(s string) string

CopyString copies a string to make it immutable

func Join

func Join(pBytes ...[]byte) []byte

Join Bytes join

func UnsafeBytes

func UnsafeBytes(s string) (bs []byte)

UnsafeBytes GetBytes returns a byte pointer without allocation

func UnsafeString

func UnsafeString(b []byte) string

UnsafeString GetString returns a string pointer without allocation

Types

This section is empty.

Jump to

Keyboard shortcuts

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