- Sublime 插件安装, 搜索
Tony Water - MacOS 手动安装
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
git clone https://github.com/evercyan/tony-water- 编辑区, 右键
- 配置快捷键
具体 command 见 Default.sublime-commands
将 JSON 字符串翻译成 Golang struct, e.g.
{
"firstName": "ryan",
"info": [
1, 2, "3"
],
"detailInfo": {
"age": 20,
"height": "172cm"
},
"som":[
{
"aaa": 1,
"bbb": 4
},
{
"bbb": "2",
"ccc": [
{
"a": [
"what"
],
"b": {
"name": "1"
},
"c": "c"
}
]
}
]
}type JSON2Go struct {
Som []struct {
Bbb interface{} `json:"bbb"`
Ccc []struct {
A []string `json:"a"`
C string `json:"c"`
B struct {
Name string `json:"name"`
} `json:"b"`
} `json:"ccc"`
Aaa int `json:"aaa"`
} `json:"som"`
Info []interface{} `json:"info"`
FirstName string `json:"first_name"`
DetailInfo struct {
Height string `json:"height"`
Age int `json:"age"`
} `json:"detail_info"`
}
