cast

package
v0.0.0-...-662b5c6 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertIntToTime

func ConvertIntToTime(timestampInt int64, timeUnit time.Duration) time.Time

ConvertIntToTime 将整数时间戳转换为 time.Time

func ToBool

func ToBool(value interface{}) bool

ToBool converts an interface{} to bool. It returns false if conversion fails.

func ToBoolE

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

ToBoolE converts an interface{} to bool with error handling. Returns the converted bool value and nil error if successful. Returns false and an error if conversion fails.

func ToDurationE

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

ToDurationE converts an interface{} to time.Duration with error handling. Returns the converted duration value and nil error if successful. Returns 0 and an error if conversion fails.

func ToFloat64

func ToFloat64(value interface{}) float64

ToFloat64 converts an interface{} to float64. It returns 0 if conversion fails.

func ToFloat64E

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

ToFloat64E converts an interface{} to float64 with error handling. Returns the converted float64 value and nil error if successful. Returns 0 and an error if conversion fails.

func ToInt

func ToInt(value interface{}) int

ToInt converts an interface{} to int. It returns 0 if conversion fails.

func ToInt64

func ToInt64(value interface{}) int64

ToInt64 converts an interface{} to int64. It returns 0 if conversion fails.

func ToInt64E

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

ToInt64E converts an interface{} to int64 with error handling. Returns the converted int64 value and nil error if successful. Returns 0 and an error if conversion fails.

func ToIntE

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

ToIntE converts an interface{} to int with error handling. Returns the converted int value and nil error if successful. Returns 0 and an error if conversion fails.

func ToString

func ToString(input interface{}) string

ToString converts an interface{} to string. It returns empty string if conversion fails.

func ToStringE

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

ToStringE converts an interface{} to string with error handling. Returns the converted string value and nil error if successful. Returns empty string and an error if conversion fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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