basic

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBool

func ToBool(value interface{}) bool

ToBool converts any type to bool.

func ToBoolE

func ToBoolE(value interface{}) (bool, error)

ToBoolE converts any type to bool with error.

func ToComplex64

func ToComplex64(value interface{}) complex64

ToComplex64 converts any type to complex64.

func ToComplex64E

func ToComplex64E(value interface{}) (complex64, error)

ToComplex64E converts any type to complex64 with error.

func ToComplex128

func ToComplex128(value interface{}) complex128

ToComplex128 converts any type to complex128.

func ToComplex128E

func ToComplex128E(value interface{}) (complex128, error)

ToComplex128E converts any type to complex128 with error.

func ToDuration added in v0.1.2

func ToDuration(value interface{}) time.Duration

ToDuration converts any type to time.Duration.

func ToDurationE added in v0.1.2

func ToDurationE(value interface{}) (time.Duration, error)

ToDurationE converts any type to time.Duration with error.

func ToFloat32

func ToFloat32(value interface{}) float32

ToFloat32 converts any type to float32.

func ToFloat32E

func ToFloat32E(value interface{}) (float32, error)

ToFloat32E converts any type to float32 with error.

func ToFloat64

func ToFloat64(value interface{}) float64

ToFloat64 converts any type to float64.

func ToFloat64E

func ToFloat64E(value interface{}) (float64, error)

ToFloat64E converts any type to float64 with error.

func ToInt

func ToInt(value interface{}) int

ToInt converts any type to int.

func ToInt8

func ToInt8(value interface{}) int8

ToInt8 converts any type to int8

func ToInt8E

func ToInt8E(value interface{}) (int8, error)

ToInt8E converts any type to int8 with error

func ToInt16

func ToInt16(value interface{}) int16

ToInt16 converts any type to int16

func ToInt16E

func ToInt16E(value interface{}) (int16, error)

ToInt16E converts any type to int16 with error

func ToInt32

func ToInt32(value interface{}) int32

ToInt32 converts any type to int32

func ToInt32E

func ToInt32E(value interface{}) (int32, error)

ToInt32E converts any type to int32 with error

func ToInt64

func ToInt64(value interface{}) int64

ToInt64 converts any type to int64.

func ToInt64E

func ToInt64E(value interface{}) (int64, error)

ToInt64E converts any type to int64 with error.

func ToIntE

func ToIntE(value interface{}) (int, error)

ToIntE converts any type to int with error.

func ToString

func ToString(value interface{}) string

ToString converts any type to string

func ToStringE

func ToStringE(value interface{}) (string, error)

ToStringE converts any type to string with error

func ToTime

func ToTime(value interface{}, formats ...string) time.Time

ToTime converts any type to time.Time. When value is a string, it will be parsed using the formats.

func ToTimeE

func ToTimeE(value interface{}, formats ...string) (time.Time, error)

ToTimeE converts any type to time.Time with error. When value is a string, it will be parsed using the formats.

func ToUint

func ToUint(value interface{}) uint

ToUint converts any type to uint

func ToUint8

func ToUint8(value interface{}) uint8

ToUint8 converts any type to uint8

func ToUint8E

func ToUint8E(value interface{}) (uint8, error)

ToUint8E converts any type to uint8 with error

func ToUint16

func ToUint16(value interface{}) uint16

ToUint16 converts any type to uint16

func ToUint16E

func ToUint16E(value interface{}) (uint16, error)

ToUint16E converts any type to uint16 with error

func ToUint32

func ToUint32(value interface{}) uint32

ToUint32 converts any type to uint32

func ToUint32E

func ToUint32E(value interface{}) (uint32, error)

ToUint32E converts any type to uint32 with error

func ToUint64

func ToUint64(value interface{}) uint64

ToUint64 converts any type to uint64

func ToUint64E

func ToUint64E(value interface{}) (uint64, error)

ToUint64E converts any type to uint64 with error

func ToUintE

func ToUintE(value interface{}) (uint, error)

ToUintE converts any type to uint with error

Types

This section is empty.

Jump to

Keyboard shortcuts

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