result

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unwrap

func Unwrap[T any](r Result[T]) (T, error)

Types

type Result

type Result[T any] struct {
	Ok  T
	Err error
}

func Err

func Err(err error) Result[any]

func Ok

func Ok[T any](ok T) Result[T]

func Wrap

func Wrap[T any](ok T, err error) Result[T]

func (Result[T]) IsErr

func (r Result[T]) IsErr() bool

func (Result[T]) IsOk

func (r Result[T]) IsOk() bool

func (Result[T]) Unwrap

func (r Result[T]) Unwrap() (T, error)

Jump to

Keyboard shortcuts

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