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/
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 =