unsafeConvert

package module
v0.0.0-...-4dde7f5 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 2 Imported by: 1

README

Unsafe string↔[]byte conversion library

The library functions for unsafely convert between a string and a slice of bytes. You probably shouldn’t use it unless you need to squeeze extra performance from your performance-critical code path.

See https://mina86.com/2017/golang-string-and-bytes/ for some more info.

Documentation

Overview

Package unsafeConvert provides functions for unsafely convert between a string and a slice of bytes. You probably shouldn’t use it unless you need to squeeze extra performance from your performance-critical code path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(str string) []byte

Bytes converts a string into a slice of bytes without performing a copy. NOTE: This is an unsafe operation and may lead to problems if the bytes are changed.

func String

func String(bytes []byte) string

String converts a slice of bytes into a string without performing a copy. NOTE: This is an unsafe operation and may lead to problems if the bytes passed as argument are changed while the string is used. No checking whether bytes are valid UTF-8 data is performed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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