result

package
v0.0.0-...-6940623 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result[T any] struct {
	// contains filtered or unexported fields
}

func Error

func Error[T any](err error) Result[T]

produce an error with garbage value

func Ok

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

produce a value with error == nil

func (*Result[T]) IsOk

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

check for an error

func (*Result[T]) UnwrapErr

func (r *Result[T]) UnwrapErr() error

get error

func (*Result[T]) UnwrapVal

func (r *Result[T]) UnwrapVal() T

get value

Jump to

Keyboard shortcuts

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