Documentation
¶
Index ¶
- func ConvertIntToTime(timestampInt int64, timeUnit time.Duration) time.Time
- func ToBool(value interface{}) bool
- func ToBoolE(value interface{}) (bool, error)
- func ToDurationE(value interface{}) (time.Duration, error)
- func ToFloat64(value interface{}) float64
- func ToFloat64E(value interface{}) (float64, error)
- func ToInt(value interface{}) int
- func ToInt64(value interface{}) int64
- func ToInt64E(value interface{}) (int64, error)
- func ToIntE(value interface{}) (int, error)
- func ToString(input interface{}) string
- func ToStringE(input interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertIntToTime ¶
ConvertIntToTime 将整数时间戳转换为 time.Time
func ToBool ¶
func ToBool(value interface{}) bool
ToBool converts an interface{} to bool. It returns false if conversion fails.
func ToBoolE ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.
Types ¶
This section is empty.