Skip to content

go-zoox/safe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Safe

Safe function execution without panic

PkgGoDev Build Status Go Report Card Coverage Status GitHub issues Release

Installation

To install the package, run:

go get github.com/go-zoox/safe

Getting Started

import (
  "testing"
  "github.com/go-zoox/safe"
)

func main(t *testing.T) {
	loadConfig := func() {
		panic("load config panic")
	}

	if err := safe.Do(loadConfig); err != nil {
		log.Error(err)
	}
}

Inspired By

License

GoZoox is released under the MIT License.

About

Safe function execution without panic

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages