Documentation
¶
Overview ¶
Package conversion provides utilities for converting between types.
Index ¶
- func FromJSON(jsonStr string, target interface{}) error
- func ToBool(value interface{}) (bool, error)
- func ToFloat32(value interface{}) (float32, error)
- func ToFloat64(value interface{}) (float64, error)
- func ToInt(value interface{}) (int, error)
- func ToInt64(value interface{}) (int64, error)
- func ToJSON(value interface{}) (string, error)
- func ToMap(value interface{}) (map[string]interface{}, error)
- func ToPrettyJSON(value interface{}) (string, error)
- func ToSlice(value interface{}) ([]interface{}, error)
- func ToString(value interface{}) (string, error)
- func ToTime(value interface{}) (time.Time, error)
- func ToUint64(value interface{}) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToPrettyJSON ¶ added in v1.2.0
ToPrettyJSON converts a Go value to a formatted JSON string with indentation.
func ToSlice ¶
func ToSlice(value interface{}) ([]interface{}, error)
ToSlice converts a value to []interface{}.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.