unsafemanip

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSliceLen

func SetSliceLen(s *[]byte, l int) (prevLen int)

SetSliceLen sets a byte slices length and returns its previous length. Deprecated: You should use `bytes = bytes[:length]` instead as performance is identical.

func SetStringLen

func SetStringLen(s *string, l int) (prevLen int)

SetStringLen sets a strings length and returns its previous length.

func StringToBytes

func StringToBytes(s string) []byte

StringToBytes converts string to byte slice without escaping to the heap.

func StringToBytesFast

func StringToBytesFast(s *string) []byte

StringToBytesFast converts string to byte slice without escaping to the heap. NOTE: It is not guarenteed to set the cap correctly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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