util

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 3 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(c io.Closer) error

Close 关闭指定的 closer

func IsEOF

func IsEOF(err error) bool

IsEOF 检查并判断 err 是否为 EOF

func PumpStream

func PumpStream(src io.Reader, dst io.Writer, buffer []byte) (int64, error)

PumpStream 把数据从 src 读出来,并写入到 dst. 返回成功写入的字节数.

Types

type LenFn added in v0.9.2

type LenFn func() int

LenFn 定义 Len 函数

type LessFn added in v0.9.2

type LessFn func(i1, i2 int) bool

LessFn 定义 Less 函数

type Sorter added in v0.9.2

type Sorter struct {
	OnLen  LenFn
	OnLess LessFn
	OnSwap SwapFn
}

Sorter 是一个排序工具

func (*Sorter) Len added in v0.9.2

func (inst *Sorter) Len() int

func (*Sorter) Less added in v0.9.2

func (inst *Sorter) Less(i1, i2 int) bool

func (*Sorter) Sort added in v0.9.2

func (inst *Sorter) Sort()

Sort 排序

func (*Sorter) Swap added in v0.9.2

func (inst *Sorter) Swap(i1, i2 int)

type SwapFn added in v0.9.2

type SwapFn func(i1, i2 int)

SwapFn 定义 Swap 函数

Jump to

Keyboard shortcuts

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