tkstar

package module
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README

TkStar

assignment to entry in nil map

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTime

func BuildTime() string

BuildTime 输出并返回当前可执行文件的最后修改时间。 注意:这并不是准确的编译时间,而是文件的最后写入时间。 return: 时间字符串,格式 "06.0102.1504"

func CheckErr

func CheckErr(err error, errString ...string) bool

CheckErr 错误检测辅助函数。 如果 err 不为 nil,打印日志并返回 false;否则返回 true。 param: err 错误信息 param: errString 自定义错误提示前缀 return: 无错误 true, 有错误 false

func HelperRemoveDuplicates

func HelperRemoveDuplicates(s []string) []string

HelperRemoveDuplicates 对字符串切片进行去重和去空处理。 param: s 待处理的切片 return: 处理后的切片

func IsDebug

func IsDebug() bool

IsDebug 判断当前环境是否为 Debug 模式。 通过检查执行文件路径中是否包含 "Temp" 和 "go-build" 来判断(通常适用于 go run)。 return: true: Debug模式, false: Release模式

func LogFile added in v1.0.2

func LogFile(logFileName string, systemLog bool) (*logger.Logger, error)

LogFile 初始化日志系统,支持写入文件和系统日志。 param: logFileName 日志文件名前缀 (不含 .log) param: systemLog 是否写入系统事件日志 (Windows Event Log / Syslog) return: Logger 实例指针, 错误信息

func RandAtomic

func RandAtomic(max int) int

RandAtomic 生成 [0, max) 范围内的随机整数。 param: max 最大值(不包含) return: 随机数

func RandAtomicRadius

func RandAtomicRadius(min, max int) int

RandAtomicRadius 生成 [min, max] 范围内的随机整数。 param: min 最小值 param: max 最大值 return: 随机数

Types

This section is empty.

Directories

Path Synopsis
* @Author: 2Kil * @Date: 2025-09-28 13:46:43 * @LastEditors: 2Kil * @LastEditTime: 2025-12-15 11:44:30 * @Description:网络相关
* @Author: 2Kil * @Date: 2025-09-28 13:46:43 * @LastEditors: 2Kil * @LastEditTime: 2025-12-15 11:44:30 * @Description:网络相关

Jump to

Keyboard shortcuts

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