sandbox

package
v0.308.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

README

Sandbox

Sandbox lets you run a function in a safe, isolated environment and provides clear feedback if any panic or goexit occurs.

go test -run - -bench .
Nanoseconds per Operation
sandbox.Run 360.8 ns/op
go + recover in defer 336.0 ns/op

Environment:

  • OS: darwin
  • Arch: arm64
  • Test duration: 3.421s

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type O

type O struct {
	OK     bool
	Panic  bool
	Goexit bool

	PanicValue any
}

func Run

func Run(fn func()) O

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL