package main

import "fmt"
import "encoding/json"

type Rec struct {
    recordId    string `json:"recordId"`
    cpmId       string `json:"cpmId"`
    tpDataType  string `json:"tpDataType"`
    tpData      string `json:"tpData"`
    blockId     string `json:"blockId"`
}

func main() {
    
    var data = 
[]byte(`{"recordId":"aaa","cpmId":"bbb","tpDataType":"ccc","tpData":"ddd","blockId":"eee"}`)
    var app Rec
    err := json.Unmarshal(data, &app)   
    
    fmt.Println(err)
    fmt.Printf("%v", app)
}
    
Output:

<nil>
{    }





This Program prints empty Json. Please help me to resolve this.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to