package main
import (
"encoding/json"
"fmt"
"io/ioutil"
)
type product struct {
Productid string
Productname string
Unitcost float32
Status string
Listprice float32
Attr1 string
Itemid string
}
type grid struct {
Total int
Rows []product
}
func main() {
var grid grid
data, err := ioutil.ReadFile("datagrid_data1.json")
if err != nil {
fmt.Println("ReadFile:", err.Error())
}
json.Unmarshal(data, grid)
fmt.Println(grid)
fmt.Println("----------------------------")
b, _ := json.Marshal(grid)
fmt.Println(string(b))
}