Files
opencloud/vendor/github.com/gookit/goutil/byteutil
PC Kitty d97217f22c Update github.com/gookit/goutil to v0.7.4 for FreeBSD compatibility
The goutil that OpenCloud currently uses is one version from the release that adds FreeBSD support, this now compiles successfully on FreeBSD.
2026-04-28 18:03:17 +02:00
..

Bytes Util

Provide some common bytes util functions.

Install

go get github.com/gookit/goutil/byteutil

Go docs

Functions API

Note

: doc by run go doc ./byteutil

func AppendAny(dst []byte, v any) []byte
func FirstLine(bs []byte) []byte
func IsNumChar(c byte) bool
func Md5(src any) []byte
func Random(length int) ([]byte, error)
func SafeString(bs []byte, err error) string
func StrOrErr(bs []byte, err error) (string, error)
func String(b []byte) string
func ToString(b []byte) string
type Buffer struct{ ... }
func NewBuffer() *Buffer
type BytesEncoder interface{ ... }
type ChanPool struct{ ... }
func NewChanPool(maxSize int, width int, capWidth int) *ChanPool
type StdEncoder struct{ ... }
func NewStdEncoder(encFn func(src []byte) []byte, decFn func(src []byte) ([]byte, error)) *StdEncoder

Code Check & Testing

gofmt -w -l ./
golint ./...

Testing:

go test -v ./byteutil/...

Test limit by regexp:

go test -v -run ^TestSetByKeys ./byteutil/...