Closed buzzer-re closed 2 years ago
Checklist
Description cmdj and cmdj returns an interface, a better approach is to let the developer sent an already known struct type and works just like the json.Unmarshal method.
cmdj
json.Unmarshal
inst := Instruction{} r2.Cmdjf("pdj %d @ %d ~{0}", &inst, numOpcodes, address)
Where the struct Instruction is an already built struct with the required fields from the json response.
Instruction
Checklist
Description
cmdj
andcmdj
returns an interface, a better approach is to let the developer sent an already known struct type and works just like thejson.Unmarshal
method.Where the struct
Instruction
is an already built struct with the required fields from the json response.