Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v1.0.0-starmap Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckList

func CheckList(target []string) bool

CheckList 检查列表发现空返回false

func CheckPid

func CheckPid(pid string) (res string)

CheckPid 检查pid是哪家单位

func DName

func DName(str string) (srt string)

func DelInList

func DelInList(target string, list []string) []string

func DelListInList

func DelListInList(original []string, remove []string) []string

func ExportExcel

func ExportExcel(sheetName string, headers []string, rows [][]interface{}, f *excelize.File) (*excelize.File, error)

ExportExcel 导出Excel文件 sheetName 工作表名称, 注意这里不要取sheet1这种名字,否则导致文件打开时发生部分错误。 headers 列名切片, 表头 rows 数据切片,是一个二维数组 f 为了创建多个单元格,得把标签往外放

func ExtractPortString

func ExtractPortString(rawURL string) (string, error)

func FileExists

func FileExists(filename string) bool

FileExists checks if a file exists and is not a directory

func FolderExists

func FolderExists(folderpath string) bool

FolderExists checks if a folder exists

func FormatInvest

func FormatInvest(scale string) float64

func GetConfigPath

func GetConfigPath() string

func HasStdin

func HasStdin() bool

HasStdin determines if the user has piped input

func IsInList

func IsInList(target string, list []string) bool

func Md5

func Md5(src string) string

Md5 MD5加密 src 源字符

func MergeMap

func MergeMap(s map[string][]map[string]string, list map[string][]map[string]string)

MergeMap 合并map s: 源map,list: 目标map

func PathExists

func PathExists(path string) (bool, error)

PathExists 判断文件/文件夹是否存在

func RandomElement

func RandomElement(c string) string

RandomElement 从一个字符串切片中随机返回一个元素。

func RangeRand

func RangeRand(min, max int64) int64

RangeRand 生成区间[-m, n]的安全随机数

func ReadFileOutLine

func ReadFileOutLine(filename string) []string

func ReadImf

func ReadImf(input io.Reader) []string

func SetStr

func SetStr(target []string) []string

SetStr 数据去重 target 输入数据

func StreamWriterFunc

func StreamWriterFunc(contents [][]string)

func TBS

func TBS(h []string, ep []string, name string, data []gjson.Result)

TBS 展示表格

func VerifyEmailFormat

func VerifyEmailFormat(email string) bool

func WriteFile

func WriteFile(str string, path string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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