init repo

This commit is contained in:
liuyuanchuang
2025-12-10 18:33:37 +08:00
commit 48e63894eb
2408 changed files with 1053045 additions and 0 deletions

18
pkg/utils/routine.go Normal file
View File

@@ -0,0 +1,18 @@
package utils
import (
"context"
"gitea.com/bitwsd/core/common/log"
)
func SafeGo(fn func()) {
go func() {
defer func() {
if err := recover(); err != nil {
log.Error(context.Background(), "panic recover", "err", err)
}
}()
fn()
}()
}