bytes

package
v0.0.0-...-82e7740 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package bytes implements functions for the manipulation of byte slices. It is analogous to the facilities of the strings package.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHex

func IsHex(c byte) bool

IsHex to determine whether the hex character

func NewBuffer

func NewBuffer() bytes.Buffer

NewBuffer creates a new Buffer.

func SetPriority

func SetPriority(value int)

SetPriority sets the output priority for the logging.

func TrimRightNul

func TrimRightNul(src []byte) []byte

TrimRightNul trim \x00 character at the end

Example
package main

import (
	"fmt"
	"gopkg.in/goyy/goyy.v0/util/bytes"
)

func main() {
	a := [10]byte{1, 2, 3}
	src := a[:]
	fmt.Printf("%q\n", src)
	fmt.Printf("%q\n", bytes.TrimRightNul(src))

}
Output:

"\x01\x02\x03\x00\x00\x00\x00\x00\x00\x00"
"\x01\x02\x03"

Types

This section is empty.

Jump to

Keyboard shortcuts

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