1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-09 12:40:24 +08:00

add channel patch/delete

This commit is contained in:
源文雨
2023-10-10 22:02:52 +09:00
parent f04743c7a5
commit 30554f4ffc
9 changed files with 268 additions and 51 deletions

View File

@@ -5,20 +5,6 @@ import (
"strings"
)
// getCurrentFuncName 获取当前函数名
func getCurrentFuncName() string {
pc, _, _, ok := runtime.Caller(1)
if !ok {
return ""
}
fullname := runtime.FuncForPC(pc).Name()
i := strings.LastIndex(fullname, ".") + 1
if i <= 0 || i >= len(fullname) {
return fullname
}
return fullname[i:]
}
// getCallerFuncName 获取调用者函数名
func getCallerFuncName() string {
pc, _, _, ok := runtime.Caller(2)