Marshal into a bson.Raw
问题 Using gopkg.in/mgo.v2/bson, I wonder how to marshal an interface{} value into a value of type bson.Raw . The documentation for bson.Raw states: Using this type it is possible to unmarshal or marshal values partially. But I can't find a Marshal function that would return bson.Raw . What am I missing? Example of what I try to do: package main import ( "fmt" "gopkg.in/mgo.v2/bson" ) func main() { // How to avoid a MarshalRaw help function? raw, err := MarshalRaw("Hello world") if err != nil {