runtime

package
v1.20.6 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplicationName added in v1.13.8

func ApplicationName() string

ApplicationName 获取执行文件名

func Caller

func Caller() (function, file string, line int)

Caller 获取正在运行的函数名, 文件名以及行号

func CatchPanic added in v1.13.8

func CatchPanic(format string, a ...any)

CatchPanic 捕获panic

func Debug added in v1.13.8

func Debug() bool

Debug go编译tag debug状态

运行和编译增加 -tags="dev"

func FuncInfo

func FuncInfo(v any) (nameOfFunction, filename string, lineNumber int)

FuncInfo 获取函数信息

v 接收func类型和uintptr

func FuncName

func FuncName(v any) (nameOfFunction string)

FuncName 获取函数名

func GoMaxProcs added in v1.13.8

func GoMaxProcs(n ...int)

GoMaxProcs 设置CPU核数

func IgnorePanic added in v1.16.7

func IgnorePanic(format string, a ...any)

IgnorePanic 通用捕获panic, 忽略异常, 继续执行

func IgnorePanicAndNoLog added in v1.18.9

func IgnorePanicAndNoLog()

IgnorePanicAndNoLog 忽略panic且不记录日志

func SetDebug added in v1.14.4

func SetDebug(enable bool)

SetDebug 重置debug状态

Types

This section is empty.

Jump to

Keyboard shortcuts

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