just

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check added in v0.20.1

func Check(err error)

Check check no error or else panic.

func Must added in v0.23.2

func Must[T any](value T, err error) T

Must Must get value with no error or else panic.

func Try

func Try[T any](f func() T) (t T, err error)

Try recover panic from f and save the recovered value to error.

func TryDo

func TryDo(f func()) (err error)

TryDo is similar to Try but for function without 0 result.

func TryGo

func TryGo(f func()) <-chan error

TryGo spawn a new goroutine and recover panic from f and send the recovered value or nil to error chan.

Types

type PanicError

type PanicError struct {
	Value any
}

func (*PanicError) Error

func (p *PanicError) Error() string

Jump to

Keyboard shortcuts

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