package main
import (
"encoding/json"
"fmt"
)
func main() {
str := `{"id":1,"name":"Name 1","price":5.6,"status":true}`
var product = make(map[string]interface{})
err := json.Unmarshal([]byte(str), &product)
if err != nil {
fmt.Println(err.Error())
} else {
fmt.Println(product)
}
}
Output
map[id:1 name:Name 1 price:5.6 status:true]