convert

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToMap added in v0.1.6

func BytesToMap(v []byte) (types.Map[any], error)

func IgnoreErr added in v0.2.6

func IgnoreErr[T any](v T, _ error) T

func NullToPtr added in v0.2.4

func NullToPtr[T any](v types.Null[T]) *T

func Ptr added in v0.2.6

func Ptr[T any](v T) *T

func PtrToZero added in v0.2.6

func PtrToZero[T any](v *T) T

func RawTo added in v0.4.6

func RawTo[T any](v []byte) (*T, error)

RawTo converts a byte slice to a type T using JSON decoding.

func RawToNull added in v0.5.5

func RawToNull[T any](v []byte) (types.Null[T], error)

func SQLNullToPtr

func SQLNullToPtr[T any](v sql.Null[T]) *T

func StringPtrToTime added in v0.1.6

func StringPtrToTime(v *string, opts ...OptionTime) (time.Time, error)

func StringPtrToTimePtr added in v0.1.6

func StringPtrToTimePtr(v *string, opts ...OptionTime) (*time.Time, error)

func StringToTime added in v0.1.6

func StringToTime(v string, opts ...OptionTime) (time.Time, error)

func TimeToStringPtr added in v0.1.6

func TimeToStringPtr(v *time.Time, opts ...OptionTime) *string

Types

type OptionTime

type OptionTime func(o *optionTime)

func WithTimeFormat

func WithTimeFormat(format string) OptionTime

Jump to

Keyboard shortcuts

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