nullable

package
v0.0.0-...-53a6fda Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: BSD-2-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Type

type Type[T any] struct {
	// Value is the value (can be nil)
	Value T
	// Valid is true if the value is not nil.
	Valid bool
}

Type can contain a nil value.

func Any

func Any[T any](v *T) Type[T]

Any creates a new Type with the given value.

func Int

func Int[T int | int64](v *T) Type[int]

Int creates a new NullableType with the given int value.

func (*Type[T]) ValuePtr

func (t *Type[T]) ValuePtr() *T

ValuePtr returns a pointer to the value.

Jump to

Keyboard shortcuts

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