I use go-worker to handle resque jobs. The job has a payload that has a nested JSON structure as follows:
[{ "key-a":"val-a", "key-b":"val-b", "files":[{ "key-a": [ {"a":"b","c": "d"}, {"e":"f","g": "h"} ], "key-b": [ {"a":"b","c": "d"}, {"e":"f","g": "h"} ] }] }]
Now go-worker gives me args ...interface{} , which represents the JSON payload, not the actual JSON text. Is there an idiomatic way to convert this ( args ) to the correct types (you can use a different package for this.) Using type statements manually seems a little tedious for such a thing.
source share