I'm using the go-worker to process resque jobs. A job has a payload which has a nested JSON structure like this:
[{
"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 that JSON payload, not the actual JSON text. Is there an idiomatic way to convert that(args
) to the correct types (could use another package to do this.) Using type assertions manually seems a bit tedious for such a thing.