I have the following code:
a := alert{} //structure I have with a few fields and all string types
tmp := req.FormValue("payload") //grab POST var from call
json.Unmarshal( []byte(tmp), &a ); //unmarshal and put fields into alert struct
I’ve seen examples all over using this syntax and the tmp var does contain my json string as I’d expect. But unmarshal command results in an empty alert struct and I get no errors.
How would I get this to work properly as I’m obviously missing something.
Thanks,