Browse JSON2Go Sublime Plugin: make json string to Go struct
Installs Total 389 Win 0 Mac 389 Linux 0 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 2 3 4 Apr 3 Mar 31 Mar 28 Mar 25 Mar 22 Mar 19 Mar 16 Mar 13 Mar 10 Mar 7 Mar 4 Mar 1 Feb 26 Feb 23 Feb 20 Apr 3
Linux: 0
Mac: 0
Windows: 0 Apr 2
Linux: 0
Mac: 0
Windows: 0 Apr 1
Linux: 0
Mac: 0
Windows: 0 Mar 31
Linux: 0
Mac: 0
Windows: 0 Mar 30
Linux: 0
Mac: 0
Windows: 0 Mar 29
Linux: 0
Mac: 0
Windows: 0 Mar 28
Linux: 0
Mac: 0
Windows: 0 Mar 27
Linux: 0
Mac: 0
Windows: 0 Mar 26
Linux: 0
Mac: 0
Windows: 0 Mar 25
Linux: 0
Mac: 0
Windows: 0 Mar 24
Linux: 0
Mac: 0
Windows: 0 Mar 23
Linux: 0
Mac: 0
Windows: 0 Mar 22
Linux: 0
Mac: 0
Windows: 0 Mar 21
Linux: 0
Mac: 0
Windows: 0 Mar 20
Linux: 0
Mac: 0
Windows: 0 Mar 19
Linux: 0
Mac: 0
Windows: 0 Mar 18
Linux: 0
Mac: 0
Windows: 0 Mar 17
Linux: 0
Mac: 0
Windows: 0 Mar 16
Linux: 0
Mac: 0
Windows: 0 Mar 15
Linux: 0
Mac: 0
Windows: 0 Mar 14
Linux: 0
Mac: 0
Windows: 0 Mar 13
Linux: 0
Mac: 0
Windows: 0 Mar 12
Linux: 0
Mac: 0
Windows: 0 Mar 11
Linux: 0
Mac: 0
Windows: 0 Mar 10
Linux: 0
Mac: 0
Windows: 0 Mar 9
Linux: 0
Mac: 0
Windows: 0 Mar 8
Linux: 0
Mac: 0
Windows: 0 Mar 7
Linux: 0
Mac: 0
Windows: 0 Mar 6
Linux: 0
Mac: 0
Windows: 0 Mar 5
Linux: 0
Mac: 0
Windows: 0 Mar 4
Linux: 0
Mac: 0
Windows: 0 Mar 3
Linux: 0
Mac: 0
Windows: 0 Mar 2
Linux: 0
Mac: 0
Windows: 0 Mar 1
Linux: 0
Mac: 0
Windows: 0 Feb 28
Linux: 0
Mac: 0
Windows: 0 Feb 27
Linux: 0
Mac: 0
Windows: 0 Feb 26
Linux: 0
Mac: 0
Windows: 0 Feb 25
Linux: 0
Mac: 0
Windows: 0 Feb 24
Linux: 0
Mac: 0
Windows: 0 Feb 23
Linux: 0
Mac: 0
Windows: 0 Feb 22
Linux: 0
Mac: 0
Windows: 0 Feb 21
Linux: 0
Mac: 0
Windows: 0 Feb 20
Linux: 0
Mac: 0
Windows: 0 Feb 19
Linux: 0
Mac: 0
Windows: 0 Feb 18
Linux: 0
Mac: 0
Windows: 0 Apr 3
Linux: 0
Mac: 0
Windows: 0 Apr 2
Linux: 0
Mac: 0
Windows: 0 Apr 1
Linux: 0
Mac: 0
Windows: 0 Mar 31
Linux: 0
Mac: 0
Windows: 0 Mar 30
Linux: 0
Mac: 0
Windows: 0 Mar 29
Linux: 0
Mac: 0
Windows: 0 Mar 28
Linux: 0
Mac: 0
Windows: 0 Mar 27
Linux: 0
Mac: 0
Windows: 0 Mar 26
Linux: 0
Mac: 0
Windows: 0 Mar 25
Linux: 0
Mac: 0
Windows: 0 Mar 24
Linux: 0
Mac: 0
Windows: 0 Mar 23
Linux: 0
Mac: 0
Windows: 0 Mar 22
Linux: 0
Mac: 0
Windows: 0 Mar 21
Linux: 0
Mac: 0
Windows: 0 Mar 20
Linux: 0
Mac: 0
Windows: 0 Mar 19
Linux: 0
Mac: 0
Windows: 0 Mar 18
Linux: 0
Mac: 0
Windows: 0 Mar 17
Linux: 0
Mac: 0
Windows: 0 Mar 16
Linux: 0
Mac: 0
Windows: 0 Mar 15
Linux: 0
Mac: 0
Windows: 0 Mar 14
Linux: 0
Mac: 0
Windows: 0 Mar 13
Linux: 0
Mac: 0
Windows: 0 Mar 12
Linux: 0
Mac: 0
Windows: 0 Mar 11
Linux: 0
Mac: 0
Windows: 0 Mar 10
Linux: 0
Mac: 0
Windows: 0 Mar 9
Linux: 0
Mac: 0
Windows: 0 Mar 8
Linux: 0
Mac: 0
Windows: 0 Mar 7
Linux: 0
Mac: 0
Windows: 0 Mar 6
Linux: 0
Mac: 0
Windows: 0 Mar 5
Linux: 0
Mac: 0
Windows: 0 Mar 4
Linux: 0
Mac: 0
Windows: 0 Mar 3
Linux: 0
Mac: 0
Windows: 0 Mar 2
Linux: 0
Mac: 0
Windows: 0 Mar 1
Linux: 0
Mac: 0
Windows: 0 Feb 28
Linux: 0
Mac: 0
Windows: 0 Feb 27
Linux: 0
Mac: 0
Windows: 0 Feb 26
Linux: 0
Mac: 0
Windows: 0 Feb 25
Linux: 0
Mac: 0
Windows: 0 Feb 24
Linux: 0
Mac: 0
Windows: 0 Feb 23
Linux: 0
Mac: 0
Windows: 0 Feb 22
Linux: 0
Mac: 0
Windows: 0 Feb 21
Linux: 0
Mac: 0
Windows: 0 Feb 20
Linux: 0
Mac: 0
Windows: 0 Feb 19
Linux: 0
Mac: 0
Windows: 0 Feb 18
Linux: 0
Mac: 0
Windows: 0 Apr 3
Linux: 0
Mac: 0
Windows: 0 Apr 2
Linux: 0
Mac: 0
Windows: 0 Apr 1
Linux: 0
Mac: 0
Windows: 0 Mar 31
Linux: 0
Mac: 0
Windows: 0 Mar 30
Linux: 0
Mac: 0
Windows: 0 Mar 29
Linux: 0
Mac: 0
Windows: 0 Mar 28
Linux: 0
Mac: 0
Windows: 0 Mar 27
Linux: 0
Mac: 0
Windows: 0 Mar 26
Linux: 0
Mac: 0
Windows: 0 Mar 25
Linux: 0
Mac: 0
Windows: 0 Mar 24
Linux: 0
Mac: 0
Windows: 0 Mar 23
Linux: 0
Mac: 0
Windows: 0 Mar 22
Linux: 0
Mac: 0
Windows: 0 Mar 21
Linux: 0
Mac: 0
Windows: 0 Mar 20
Linux: 0
Mac: 0
Windows: 0 Mar 19
Linux: 0
Mac: 0
Windows: 0 Mar 18
Linux: 0
Mac: 0
Windows: 0 Mar 17
Linux: 0
Mac: 0
Windows: 0 Mar 16
Linux: 0
Mac: 0
Windows: 0 Mar 15
Linux: 0
Mac: 0
Windows: 0 Mar 14
Linux: 0
Mac: 0
Windows: 0 Mar 13
Linux: 0
Mac: 0
Windows: 0 Mar 12
Linux: 0
Mac: 0
Windows: 0 Mar 11
Linux: 0
Mac: 0
Windows: 0 Mar 10
Linux: 0
Mac: 0
Windows: 0 Mar 9
Linux: 0
Mac: 0
Windows: 0 Mar 8
Linux: 0
Mac: 0
Windows: 0 Mar 7
Linux: 0
Mac: 0
Windows: 0 Mar 6
Linux: 0
Mac: 0
Windows: 0 Mar 5
Linux: 0
Mac: 0
Windows: 0 Mar 4
Linux: 0
Mac: 0
Windows: 0 Mar 3
Linux: 0
Mac: 0
Windows: 0 Mar 2
Linux: 0
Mac: 0
Windows: 0 Mar 1
Linux: 0
Mac: 0
Windows: 0 Feb 28
Linux: 0
Mac: 0
Windows: 0 Feb 27
Linux: 0
Mac: 0
Windows: 0 Feb 26
Linux: 0
Mac: 0
Windows: 0 Feb 25
Linux: 0
Mac: 0
Windows: 0 Feb 24
Linux: 0
Mac: 0
Windows: 0 Feb 23
Linux: 0
Mac: 0
Windows: 0 Feb 22
Linux: 0
Mac: 0
Windows: 0 Feb 21
Linux: 0
Mac: 0
Windows: 0 Feb 20
Linux: 0
Mac: 0
Windows: 0 Feb 19
Linux: 0
Mac: 0
Windows: 0 Feb 18
Linux: 0
Mac: 0
Windows: 0
Readme Source raw.githubusercontent.com JSON2Go
A Sublime plugin can translate JSON string to Go struct definition
Example
{
"name": "ryan",
"info": [
1, 2, "3"
],
"detail": {
"age": 20,
"height": "172cm"
},
"som":[
{
"aaa": 1,
"bbb": 4
},
{
"bbb": "2",
"ccc": [
{
"a": [
"what"
],
"b": {
"name":"1"
},
"c":"c"
}
]
}
]
}
To:
type Demo struct {
Detail struct {
Height string `json:"height"`
Age int `json:"age"`
} `json:"detail"`
Info []interface{} `json:"info"`
Som []struct {
Ccc []struct {
B struct {
Name string `json:"name"`
} `json:"b"`
C string `json:"c"`
A []string `json:"a"`
} `json:"ccc"`
Bbb interface{} `json:"bbb"`
Aaa int `json:"aaa"`
} `json:"som"`
Name string `json:"name"`
}
Install
MacOs:
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
git clone https://github.com/everCyan/JSON2Go
Package Control: Install Package
input `JSON2GO`
Menu
right click, the menu like this:
- JSON2Go
- JSON2Go translate JSON string to Go struct
- ToUpper translate to upper
- ToLower translate to lower
- JsonExpand translate one line json string to BASIC json struct
- JsonShrink translate json struct to one line json string
- StrEscape escape str
- StrUnescape unescape str
- UrlEncode encode url
- UrlDecode decode url
Help (JSON2Go js): https://github.com/mholt/json-to-go