ptr

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

func BoolDeref

func BoolDeref(v *bool, def bool) bool

func Deref

func Deref[T Pointerable](ptr *T, def T) T

func Duration

func Duration(v time.Duration) *time.Duration

func DurationDeref

func DurationDeref(v *time.Duration, def time.Duration) time.Duration

func Equal

func Equal[T Pointerable](a, b *T) bool

func Float32

func Float32(v float32) *float32

func Float32Deref

func Float32Deref(v *float32, def float32) float32

func Float64

func Float64(v float64) *float64

func Float64Deref

func Float64Deref(v *float64, def float64) float64

func Int

func Int(v int) *int

func Int16

func Int16(v int16) *int16

func Int16Deref

func Int16Deref(v *int16, def int16) int16

func Int32

func Int32(v int32) *int32

func Int32Deref

func Int32Deref(v *int32, def int32) int32

func Int64

func Int64(v int64) *int64

func Int64Deref

func Int64Deref(v *int64, def int64) int64

func Int8

func Int8(v int8) *int8

func Int8Deref

func Int8Deref(v *int8, def int8) int8

func IntDeref

func IntDeref(v *int, def int) int

func Ref

func Ref[T Pointerable](v T) *T

func String

func String(v string) *string

func StringDeref

func StringDeref(v *string, def string) string

func Time

func Time(v time.Time) *time.Time

func TimeDeref

func TimeDeref(v *time.Time, def time.Time) time.Time

func To

func To[T Pointerable](v T) *T

func Uint

func Uint(v uint) *uint

func Uint16

func Uint16(v uint16) *uint16

func Uint16Deref

func Uint16Deref(v *uint16, def uint16) uint16

func Uint32

func Uint32(v uint32) *uint32

func Uint32Deref

func Uint32Deref(v *uint32, def uint32) uint32

func Uint64

func Uint64(v uint64) *uint64

func Uint64Deref

func Uint64Deref(v *uint64, def uint64) uint64

func Uint8

func Uint8(v uint8) *uint8

func Uint8Deref

func Uint8Deref(v *uint8, def uint8) uint8

func UintDeref

func UintDeref(v *uint, def uint) uint

Types

type Pointerable

type Pointerable interface {
	constraints.Ordered | ~bool | time.Time
}

Jump to

Keyboard shortcuts

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