tool

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PathError ...
	PathError = errcode.NewError(baseCode+1, "路径异常:")
)

Functions

func FormatCommunicationRate

func FormatCommunicationRate(fileSize float64) (size string)

FormatCommunicationRate 通讯速率换算 传入参数单位为 B/s

func FormatFileSize

func FormatFileSize(fileSize uint64) (size string)

FormatFileSize 字节的单位转换 保留两位小数

func GbkToUtf8

func GbkToUtf8(str []byte) (b []byte, err error)

GbkToUtf8 ...

func GetAllFile

func GetAllFile(pathname string) []string

GetAllFile ...

func IsDir

func IsDir(path string) (bool, error)

IsDir 判断文件夹是否存在

func PathExists

func PathExists(path string) (bool, error)

PathExists 判断文件路径是否存在

func Pause

func Pause()

Pause 实现调用命令行的暂停

func StrToGBK

func StrToGBK(str string) (string, error)

transform UTF-8 string to GBK string and replace it, if transformed success, returned nil error, or died by error message

func StrToUtf8

func StrToUtf8(str string) (string, error)

transform GBK string to UTF-8 string and replace it, if transformed success, returned nil error, or died by error message

func Utf8ToGbk

func Utf8ToGbk(str []byte) (b []byte, err error)

transform UTF-8 bytes to GBK bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

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