original.M数组转换为字符串?以相同的结构响应http请求

I'm doing a server api using GoLang, trying to manage and answer requests made. Using net/http and github.com/gorilla/mux.

收到请求时,我使用以下结构创建响应:

type Response struct {
    Error        bool   `json:"error"`
    Msg          string `json:"msg,omitempty"`
    Data         string `json:"data,omitempty"`
    AccessToken  string `json:"access_token,omitempty"`
    RefreshToken string `json:"refresh_token,omitempty"`
}

When retrieving several message type (another struct) from the Database I get a type []primitive.M. My question is how can I transform the []primitive.M to a string to pass it as a data field? I tried to use msgsStr := Sprintf("%s", msgs) but the response seemed to come out of format.

我假设对数据字段使用字符串类型是正确的,因为目标是传递json类型信息。

直接通过[] primitive.M的结果的部分示例:

[
    {
        "_id": "xxxxx",
        "datetime": {
            "T": 1589193727,
            "I": 1
        },
        "dislikes": "4",
        "latitude": 21.5,
        "likes": "32",
        "longitude": 12.2,
        "text": "message 123!",
        "user": "user#123121"
    },
    {
        "_id": "xxxxxx",
        "datetime": {
            "T": 1589193727,
            "I": 1
        },
        "dislikes": "4",
        "latitude": 14.4,
        "likes": "32",
        "longitude": 15,
        "text": "hello! 22",
        "user": "user#123121"
    },

使用Sprintf更改后:

[map[_id:ObjectID(\"xxxxx\") datetime:{%!s(uint32=1589193727) %!s(uint32=1)} dislikes:4 latitude:%!s(float64=21.5) likes:32 longitude:%!s(float64=12.2) text:message 123! user:user#123121] map[_id:ObjectID(\"xxxxxx\") datetime:{%!s(uint32=1589193727) %!s(uint32=1)} dislikes:4 latitude:%!s(float64=14.4) likes:32 longitude:%!s(int32=15) text:hello! 22 user:user#123121]]