Re: [go-nuts] Issue with json unMarshall

2017-09-18 Thread Anil
Thanks alot!!

On Monday, 18 September 2017 18:38:49 UTC+5:30, Shawn Milochik wrote:
>
> Your struct has all unexported fields. So the json package can't see them. 
> You have to capitalize the field names. 
>

-- 
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.


[go-nuts] Issue with json unMarshall

2017-09-18 Thread Anil
package main

import "fmt"
import "encoding/json"

type Rec struct {
recordIdstring `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, )   

fmt.Println(err)
fmt.Printf("%v", app)
}

Output:


{}





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.