I have a json string like this:
{
"offset":4224368,
"fcn_addr":4224368,
"fcn_last":4224408,
"size":2,
"opcode":"add byte [rax], al",
"bytes":"0000",
"type":"add",
"type_num":17,
"type2_num":0,
"flags":[
"entry0",
"sym._start",
"section_end..plt",
"section..text"
],
"comment":"WzEzXSB2YT0weDAwNDA3NTcwIHBhPTB4MDAwMDc1NzAgc3o9MTA5OTE4NiB2c3o9MTA5OTE4NiByd3g9LXIteCAudGV4dA=="
},
{
"offset":4224370,
"fcn_addr":4224368,
"fcn_last":4224408,
"size":2,
"opcode":"add byte [rax], al",
"bytes":"0000",
"type":"add",
"type_num":17,
"type2_num":0
}}
and i have created a struct
type DisassembleOutput struct {
offset, fcn_addr, fcn_last, size int
opcode, bytes string
}
i just want to save this json into the struct like this one.
So the problem is in unmarshaling with encoding/json lib, i can't get it to work ( error is always unable to unmarshal json data into main.Disas structure).
I'm a golang newbie btw.
EDIT:
This is actually the problem http://play.golang.org/p/cpYsnXa-b9. how to parse one by one items fromm [{ ... }]