code: func (w *httpWriter) genericWrite(result interface{}) {
  
  	m := map[string]interface{}{
  		w.cmd: result,
  	}
  	switch w.contentType {
  	case "json":
  		writeJSON(&m, w.w)
  	case "bson":
  		writeBSON(&m, w.w)
  	case "msgpack":
  		writeMsgPack(&m, w.w)
  	default:
  		log.Errorf("invalid content type %s", w.contentType)
  	}
  }
docs: // http writer