@@ -85,14 +85,14 @@ func main() {
|
||||
fmt.Println(dat)
|
||||
|
||||
// In order to use the values in the decoded map,
|
||||
// we'll need to cast them to their appropriate type.
|
||||
// For example here we cast the value in `num` to
|
||||
// we'll need to convert them to their appropriate type.
|
||||
// For example here we convert the value in `num` to
|
||||
// the expected `float64` type.
|
||||
num := dat["num"].(float64)
|
||||
fmt.Println(num)
|
||||
|
||||
// Accessing nested data requires a series of
|
||||
// casts.
|
||||
// conversions.
|
||||
strs := dat["strs"].([]interface{})
|
||||
str1 := strs[0].(string)
|
||||
fmt.Println(str1)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
43e8d66fb862ea224994ca766e5689a96016f7ca
|
||||
UGeNKd-cw34
|
||||
d4dc2281f64061f077d8f1e9687538f41a339b25
|
||||
xC6SHbzGBZC
|
||||
|
||||
Reference in New Issue
Block a user