The Many Faces of Struct Tags
`json:"full_name"` Age int } gopher := &Candidate{ Name: "Gopher Cleveland", Age: 40, } asBytes, _ := json.Marshal(gopher) fmt.Println(string(asBytes)) // "{"full_name":"Gopher Cleveland","Age":40}" Tag Safety lang_gr:"ηλικία"` } gopher := &Candidate{ Name: "Gopher Cleveland", Age: 40, } asBytes, _ := langMarshaler.Marshal(gopher, "es") fmt.Println(string(asBytes)) // "{"nombre":"Gopher Cleveland","edad":40}" The Future:0 码力 | 18 页 | 148.80 KB | 1 年前3
共 1 条
- 1
相关搜索词