ref

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: BSL-1.0 Imports: 2 Imported by: 0

README

ref

Go Reference Go Report Card

About

ref is a package for Go to convert bytes to string or string to bytes without reallocating data. ref is published on https://github.com/vbsw/golib/ref and https://gitlab.com/vbsw/golib/ref.

Copyright 2020, Vitali Baumtrok (vbsw@mailbox.org).

ref is distributed under the Boost Software License, version 1.0. (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)

ref is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Boost Software License for more details.

References

Documentation

Overview

Package ref converts bytes to string or string to bytes without reallocating data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(str string) []byte

Bytes returns string as byte slice, but without copying the bytes. This is useless, actually. The returned slice has no capacity and can not be sub sliced, then using the index on string to access the bytes works as well.

func String

func String(bytes []byte) string

String returns byte slice as string, but without copying the bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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