Documentation
¶
Index ¶
- func ConvertIntToTime(timestampInt int64, timeUnit time.Duration) time.Time
- func ToBool(value any) bool
- func ToBoolE(value any) (bool, error)
- func ToDurationE(value any) (time.Duration, error)
- func ToFloat64(value any) float64
- func ToFloat64E(value any) (float64, error)
- func ToInt(value any) int
- func ToInt64(value any) int64
- func ToInt64E(value any) (int64, error)
- func ToIntE(value any) (int, error)
- func ToString(input any) string
- func ToStringE(input any) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertIntToTime ¶
ConvertIntToTime 将整数时间戳转换为 time.Time
func ToBoolE ¶
ToBoolE converts an any 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 any 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 ToFloat64E ¶
ToFloat64E converts an any to float64 with error handling. Returns the converted float64 value and nil error if successful. Returns 0 and an error if conversion fails.
func ToInt64E ¶
ToInt64E converts an any 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 any 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.