Skip to content

Commit

Permalink
add kit localcache
Browse files Browse the repository at this point in the history
  • Loading branch information
sado0823 committed Oct 13, 2023
1 parent fd5b96e commit f6183a0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/syncx/syncx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package syncx

import (
"fmt"
"log"
"runtime/debug"
)

func GoSave(fn func()) {
defer func() {
if p := recover(); p != nil {
log.Printf("[ERROR]: %s", fmt.Sprintf("%s\n%s", p, string(debug.Stack())))
}
}()

fn()
}

0 comments on commit f6183a0

Please sign in to comment.