
114
|
第
4
章
func NestedFieldCopy(obj map[string]interface{}, fields ...string)
(interface{}, bool, error)
func NestedFieldNoCopy(obj map[string]interface{}, fields ...string)
(interface{}, bool, error)
还有一些强类型的变种版本,它们会在返回值前进行一次类型转换,如果转
换失败,就会返回出错:
func NestedBool(obj map[string]interface{}, fields ...string) (bool, bool, error)
func NestedFloat64(obj map[string]interface{}, fields ...string)
(float64, bool, error)
func NestedInt64(obj map[string]interface{}, fields ...string) (int64, bool, error)
func NestedStringSlice(obj map[string]interface{}, fields ...string)
([]string, bool, error)
func NestedSlice(obj map[string]interface{}, fields ...string)
([]interface{}, ...