some

package
v0.3.89 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: MIT Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Some

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

func Empty

func Empty[T any]() Some[T]

func Of

func Of[T any](val T) Some[T]

func (Some[T]) Get

func (o Some[T]) Get() (T, bool)

func (Some[T]) IfPresent

func (o Some[T]) IfPresent(callback func(T), elseCallback ...func())

func (Some[T]) IsPresent

func (o Some[T]) IsPresent() bool

func (*Some[T]) MarshalJSON

func (o *Some[T]) MarshalJSON() ([]byte, error)

func (Some[T]) OrElse

func (o Some[T]) OrElse(val T) T

func (Some[T]) OrElseFunc

func (o Some[T]) OrElseFunc(gen func() T) T

func (Some[T]) OrPanic

func (o Some[T]) OrPanic(errs ...error) T

func (*Some[T]) UnmarshalJSON

func (o *Some[T]) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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