Documentation
¶
Overview ¶
Package cast 提供了很多类型之间相互转换的函数。
Index ¶
- func ToBool(i interface{}) bool
- func ToBoolE(i interface{}) (bool, error)
- func ToDuration(i interface{}) time.Duration
- func ToDurationE(i interface{}) (time.Duration, error)
- func ToFloat64(i interface{}) float64
- func ToFloat64E(i interface{}) (float64, error)
- func ToInt(i interface{}) int
- func ToInt64(i interface{}) int64
- func ToInt64E(i interface{}) (int64, error)
- func ToString(i interface{}) string
- func ToStringE(i interface{}) (string, error)
- func ToTime(i interface{}) time.Time
- func ToTimeE(i interface{}) (time.Time, error)
- func ToUint64(i interface{}) uint64
- func ToUint64E(i interface{}) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToDuration ¶
ToDuration casts an interface{} to a time.Duration.
func ToDurationE ¶
ToDurationE casts an interface{} to a time.Duration.
func ToFloat64E ¶
ToFloat64E casts an interface{} to a float64.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.