null

package module
v0.0.0-...-c19a9e4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Null

type Null[T any] []*T

Null 0 has -> 有值 Value 0 nil -> 值为 Null len 0 -> 未定义值 Undefined

func New

func New[T any](val T) Null[T]

func Nullable

func Nullable[T any]() Null[T]

Nullable 空值

func Undefined

func Undefined[T any]() Null[T]

Undefined 未定义

func (Null[T]) Get

func (t Null[T]) Get() (T, bool)

func (Null[T]) IsNull

func (t Null[T]) IsNull() bool

IsNull 只有长度为1 值为nil的时候为true

func (Null[T]) IsUndefined

func (t Null[T]) IsUndefined() bool

IsUndefined 切片长度为0的时候为true

func (Null[T]) MarshalJSON

func (t Null[T]) MarshalJSON() ([]byte, error)

func (Null[T]) MustGet

func (t Null[T]) MustGet() T

MustGet .

func (*Null[T]) Scan

func (t *Null[T]) Scan(value any) error

func (*Null[T]) Set

func (t *Null[T]) Set(val T)

func (*Null[T]) SetNull

func (t *Null[T]) SetNull()

func (*Null[T]) SetUndefined

func (t *Null[T]) SetUndefined()

func (*Null[T]) UnmarshalJSON

func (t *Null[T]) UnmarshalJSON(data []byte) error

func (Null[T]) Value

func (t Null[T]) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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