xxxx日本护士丰满hd|亚洲av日韩av无码av欧美av|精品国产污污网站在线看免费|日日摸日日碰夜夜爽久久|国产一区二区亚洲精品

Online JSON to Golang Struct

我要 Format JSON JSON to Postman
type JSONData struct {
	Name string `json:"name"`
	Code int `json:"code"`
	List []struct {
		Day int `json:"day"`
	} `json:"list"`
}
使用結構體
package main

import (
    "encoding/json"
    "fmt"
)

type JSONData struct {
    Name string `json:"name"`
    Code int    `json:"code"`
    List []List `json:"list"`
}
type List struct {
    Day int `json:"day"`
}

func main() {
    var jsonData JSONData
    jsonData.List = append(jsonData.List, List{1})
    jsonData.List = append(jsonData.List, List{2})

    respJson := JSONData{
        Code: 1,
        Name: Xiao Fang,
        List: jsonData.List,
    }
    b, err := json.Marshal(respJson)
    if err != nil {
        fmt.Println("JSON ERR:", err)
    }
    fmt.Println(string(b))
}
                    

Online JSON to Golang Struct Tool: To convert Golang to JSON, you need to define a struct first. If there are too many JSON fields, our workload will increase significantly. Bejson's online JSON to Golang Struct tool can quickly generate the required struct for us.

You recently used:

收藏: favorite Menu QQ
xxxx日本护士丰满hd|亚洲av日韩av无码av欧美av|精品国产污污网站在线看免费|日日摸日日碰夜夜爽久久|国产一区二区亚洲精品