Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import (
- "encoding/json"
- "fmt"
- "reflect"
- )
- func main() {
- var value map[string]interface{}
- str := []byte(`{"age":1}`)
- json.Unmarshal(str, &value)
- age := value["age"]
- fmt.Println(reflect.TypeOf(age)) // will output float64
- }
Add Comment
Please, Sign In to add comment