Skip to content

Go Package to safely call a function which may panic. The returned error can then be handled gracefully.

License

Notifications You must be signed in to change notification settings

junderhill/PanicGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PanicGuard

Go Package to safely call a function which may panic. The returned error can then be handled gracefully.

Usage

str, err := preventpanic.RunWithReturn[string](func() string {
    xraysegment.AddAnnotation("token", token)
    return "Hello World"
})

err := preventpanic.Run(func() {
    xraysegment.AddAnnotation("token", token)
})

About

Go Package to safely call a function which may panic. The returned error can then be handled gracefully.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages