After the golang array is converted to characters, how to reverse the array or map

[{"id": "114194", "bt": "title 1", "fbsj": "2018-11-12",},
{"id": "114256", "bt": "title 1", "fbsj": "2018-11-16",}]
how to convert this data to an array or map
Thank you!

Feb.08,2022

make your own parser. You can refer to the parsing of the json package to do


is it difficult to define the data structure and unmarshal it?


https://github.com/tidwall/gjson

take a look at this package. You don't have to define the structure, it's easy to use


const data = `
[
{ "id": "114194", "bt": "1", "fbsj": "2018/11/12" },
{ "id": "114256", "bt": "1", "fbsj": "2018/11/16" }
] 
`

type Question struct {
    Id, Bt, Fbsj string
}

    var q []Question
    err := json.Unmarshal([]byte(data), &q)
    if err != nil {
        log.Fatalf(err.Error())
    }
    fmt.Printf("%-sharpv", q)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bec8ab-31283.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bec8ab-31283.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?