gocommon

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Optional

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

func Empty

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

func With

func With[T any](t *T) Optional[T]

func (Optional[T]) Get

func (op Optional[T]) Get() T

func (Optional[T]) IfPresent

func (op Optional[T]) IfPresent(doSomething func(t T))

func (Optional[T]) IfPresentOrElse

func (op Optional[T]) IfPresentOrElse(doSomething func(t T), orElse func())

func (Optional[T]) IsPresent

func (op Optional[T]) IsPresent() bool

type String

type String string

func (String) IsEmpty

func (s String) IsEmpty() bool

func (String) Length

func (s String) Length() int

Jump to

Keyboard shortcuts

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