util

package
v0.0.0-...-bc0f8f2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = log.New(os.Stderr)

Functions

func AddTo

func AddTo(val int, sli *[]int, idx int)

添加到切片指定索引位置,若索引超出范围则扩容

func ConvertReader

func ConvertReader(input io.Reader) io.Reader

将字节流转换为 utf-8

func Increase

func Increase(sli *[]int, idx int)

切片指定索引位置加1,若索引超出范围则扩容

func Read

func Read(path string) (io.Reader, error)

读取文件

func UnsafeToBytes

func UnsafeToBytes(s string) []byte

unsafe 强制转换 string 为 []byte

func UnsafeToString

func UnsafeToString(b []byte) string

unsafe 强制转换 []byte 为 string

func WalkDir

func WalkDir(dir string) []string

遍历文件夹

func WalkDirWithSuffix

func WalkDirWithSuffix(dir string, suffix string) []string

遍历文件夹 + 指定后缀

Types

This section is empty.

Jump to

Keyboard shortcuts

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