I want to be able to output raw bson data I am getting from golang's mgo library to the console for debugging purposes, but have been unable to find out how to accomplish this.
With JSON I do it like this:
formatedData, err := json.MarshalIndent(rawData, "", " ")
if err != nil {
log.Print(err)
}
fmt.Printf("%s", formatedData)
Is there an equivalent way to do this with BSON?