util

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(path string) *os.File

func RenderExplainAnalyze added in v1.0.4

func RenderExplainAnalyze(rows *sql.Rows) (text string, err error)

func Slice

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

Slice converts string to slice without copy. Use at your own risk.

func String

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

String converts slice to string without copy. Use at your own risk.

Types

type BufAllocator

type BufAllocator struct {
	// contains filtered or unexported fields
}

BufAllocator helps you manage multi chunks in one []byte.

func NewBufAllocator

func NewBufAllocator() *BufAllocator

NewBufAllocator creates a NewBufAllocator

func (*BufAllocator) Alloc

func (b *BufAllocator) Alloc(n int) []byte

Alloc allocates a new chunk with the specified size n.

func (*BufAllocator) Reset

func (b *BufAllocator) Reset()

Reset resets the buffer to later reuse

Jump to

Keyboard shortcuts

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