package unsafeext

import "github.com/go-playground/pkg/v5/unsafe"

Index

Functions

func BytesToString

func BytesToString(b []byte) string

BytesToString converts an array of bytes into a string without allocating. The byte slice passed to this function is not to be used after this call as it's unsafe; you have been warned.

func StringToBytes

func StringToBytes(s string) (b []byte)

StringToBytes converts an existing string into an []byte without allocating. The string passed to this functions is not to be used again after this call as it's unsafe; you have been warned.

Source Files

conversions.go

Version
v5.2.0
Published
Nov 19, 2020
Platform
darwin/amd64
Imports
2 packages
Last checked
38 minutes ago

Tools for package owners.