Re: [go-nuts] print pointer value to json...

2016-10-19 Thread Pietro Gagliardi
You must export the struct fields in order for package json to see them. > On Oct 19, 2016, at 8:43 PM, eric wrote: > > hi, i am newer in golang. > > i want to marshal pointer value to json. > > but, i can't. how can i do that ? > > thanks, > > > package main > > import ( > "encoding/

[go-nuts] print pointer value to json...

2016-10-19 Thread eric
hi, i am newer in golang. i want to marshal pointer value to json. but, i can't. how can i do that ? thanks, package main import ( "encoding/json" "fmt" ) type KV struct { k string v string } func main() { kv := []*KV{} obj := new(KV) obj.k = "eric" obj.v = "23" kv = append(kv, obj) obj =