I have a struct as
type Result struct {
Foo *string
}
I would like to get a json object like
{"Foo": null}
How do I achieve this ?
I have tried a few things: approach 1:
var res1 *Result
json.Unmarshal(nil, &res1)
approach2
var res1 Result
res1.Foo = nil
I get a res1 struct with Foo as nil
Thanks for help!
Edit: var res1 *Result -> var res1 Result