I want to store an arbitrary json object in a struct:
type C struct { Name string `json:"name" bson:"name"` Config map[string]interface{} `json:"config" bson:"config"` }
This works fine when I store any deeply nested json object, but when I go retrieve it and mgo tries to Unmarshal it, I get
Unmarshal can't deal with struct values. Use a pointer.
I'm not sure what's supposed to be a pointer. If I change it to
Config *map[string]interface{}
the same error occurs.
The error occurs here: https://github.com/MG-RAST/golib/blob/master/mgo/bson/bson.go#L493
I don't know what it's reflecting on though.