trier

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Try

type Try[T any] struct {
	Result T     `json:"result"`
	Err    error `json:"error"`
}

func Complete

func Complete[T any](result T, err error) Try[T]

func Failure

func Failure[T any](err error) Try[T]

func Failuref

func Failuref[T any](format string, a ...any) Try[T]

func Success

func Success[T any](result T) Try[T]

func (Try[T]) Error

func (t Try[T]) Error() string

func (Try[T]) Failed

func (t Try[T]) Failed() bool

func (Try[T]) Succeeded

func (t Try[T]) Succeeded() bool

Jump to

Keyboard shortcuts

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