Skip to content

Commit b92e7a8

Browse files
committed
fix: Upgrade any modules
1 parent 58ec74d commit b92e7a8

File tree

115 files changed

+79
-38916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+79
-38916
lines changed

glide.lock

-16
This file was deleted.

glide.yaml

-5
This file was deleted.

go.mod

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module github.com/yudppp/json2struct
2+
3+
go 1.16
4+
5+
require (
6+
github.com/c9s/inflect v0.0.0-20130402162822-006c50878f3f
7+
github.com/go-openapi/swag v0.19.15
8+
github.com/hexops/vecty v0.6.0
9+
github.com/stretchr/testify v1.7.0 // indirect
10+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
11+
)

go.sum

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
github.com/c9s/inflect v0.0.0-20130402162822-006c50878f3f h1:sfSR+DQofxa5poubse9++Zv6wE70rAQ+IZQThxhVHxU=
2+
github.com/c9s/inflect v0.0.0-20130402162822-006c50878f3f/go.mod h1:IyAzlY1qfFweht0xujIYk1aO4Ele06nfXJ+E94dmGIw=
3+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
4+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7+
github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM=
8+
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
9+
github.com/hexops/vecty v0.6.0 h1:iiHfDOLEJufGy/hfPGzOTPkZe6rCszElYmUSzRQqK1w=
10+
github.com/hexops/vecty v0.6.0/go.mod h1:hVOPHAhrkXTf/9fl31Bpn2QvkW2ZOUZ0I3b3cohwCpI=
11+
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
12+
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
13+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
14+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
15+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
16+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
17+
github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
18+
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
19+
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
20+
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
21+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
22+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
23+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
24+
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
25+
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
26+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
27+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
28+
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
29+
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
30+
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
31+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
32+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
33+
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
34+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
35+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

json2struct_test.go

+18-18
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,34 @@ type TestCase struct {
1313
}
1414

1515
var testCases = []TestCase{
16-
TestCase{
16+
{
1717
Input: `{"text": "hello"}`,
1818
Expected: `type Data struct {
1919
Text string 'json:"text"'
2020
}`,
2121
},
22-
TestCase{
22+
{
2323
Input: `[{"id": 123}]`,
2424
InputOption: Options{Name: "Categories"},
2525
Expected: `type Category struct {
2626
ID int 'json:"id"'
2727
}`,
2828
},
29-
TestCase{
29+
{
3030
Input: `[{"name": 123},{"name": 3.14}]`,
3131
InputOption: Options{Name: "Tags"},
3232
Expected: `type Tag struct {
3333
Name float64 'json:"name"'
3434
}`,
3535
},
36-
TestCase{
36+
{
3737
Input: `[{"name": 123},{"name": "stringer"}]`,
3838
InputOption: Options{Name: "Tags"},
3939
Expected: `type Tag struct {
4040
Name interface{} 'json:"name"'
4141
}`,
4242
},
43-
TestCase{
43+
{
4444
Input: `{"nest": {"text": "hello"}}`,
4545
Expected: `type Data struct {
4646
Nest DataNest 'json:"nest"'
@@ -50,7 +50,7 @@ type DataNest struct {
5050
Text string 'json:"text"'
5151
}`,
5252
},
53-
TestCase{
53+
{
5454
Input: `{"nest": {"text": "hello"}}`,
5555
InputOption: Options{UseShortStruct: true},
5656
Expected: `type Data struct {
@@ -61,7 +61,7 @@ type Nest struct {
6161
Text string 'json:"text"'
6262
}`,
6363
},
64-
TestCase{
64+
{
6565
Input: `{"nest": {"text": "hello"}}`,
6666
InputOption: Options{UseLocal: true},
6767
Expected: `type data struct {
@@ -72,7 +72,7 @@ type dataNest struct {
7272
text string 'json:"text"'
7373
}`,
7474
},
75-
TestCase{
75+
{
7676
Input: `{"nest": {"text": "hello"}}`,
7777
InputOption: Options{UseOmitempty: true},
7878
Expected: `type Data struct {
@@ -83,7 +83,7 @@ type DataNest struct {
8383
Text string 'json:"text,omitempty"'
8484
}`,
8585
},
86-
TestCase{
86+
{
8787
Input: `{"nest": {"text": "hello"}}`,
8888
InputOption: Options{Prefix: "input"},
8989
Expected: `type InputData struct {
@@ -94,7 +94,7 @@ type InputDataNest struct {
9494
Text string 'json:"text"'
9595
}`,
9696
},
97-
TestCase{
97+
{
9898
Input: `{"nest": {"text": "hello"}}`,
9999
InputOption: Options{Suffix: "result"},
100100
Expected: `type DataResult struct {
@@ -105,7 +105,7 @@ type DataNestResult struct {
105105
Text string 'json:"text"'
106106
}`,
107107
},
108-
TestCase{
108+
{
109109
Input: `{"categories": [{}]}`,
110110
Expected: `type Data struct {
111111
Categories []DataCategory 'json:"categories"'
@@ -114,31 +114,31 @@ type DataNestResult struct {
114114
type DataCategory struct {
115115
}`,
116116
},
117-
TestCase{
117+
{
118118
Input: `{"categories": []}`,
119119
Expected: `type Data struct {
120120
Categories []interface{} 'json:"categories"'
121121
}`,
122122
},
123-
TestCase{
123+
{
124124
Input: `{"categories": [1]}`,
125125
Expected: `type Data struct {
126126
Categories []int 'json:"categories"'
127127
}`,
128128
},
129-
TestCase{
129+
{
130130
Input: `{"categories": [1,"abc"]}`,
131131
Expected: `type Data struct {
132132
Categories []interface{} 'json:"categories"'
133133
}`,
134134
},
135-
TestCase{
135+
{
136136
Input: `{"categories": null}`,
137137
Expected: `type Data struct {
138138
Categories interface{} 'json:"categories"'
139139
}`,
140140
},
141-
TestCase{
141+
{
142142
Input: `{"post": {"status": 1, "accept_comment": true, "title": "hello world", "tags": [1,2,4]}, "categories": [{"name": "aws", "num": 123}, {"name": 123, "num": 3.14}], "url": "http://blog.yudppp.com", "profile_image_url": "http://blog.yudppp.com/img/profile.gif", "comments": []}`,
143143
Expected: `type Data struct {
144144
Categories []DataCategory 'json:"categories"'
@@ -160,7 +160,7 @@ type DataPost struct {
160160
Title string 'json:"title"'
161161
}`,
162162
},
163-
TestCase{
163+
{
164164
Input: `[{"post": {"status": 1, "accept_comment": true, "title": "hello world", "tags": [1,2,4]}, "categories": [{"name": "aws", "num": 123}, {"name": 123, "num": 3.14}], "url": "http://blog.yudppp.com", "profile_image_url": "http://blog.yudppp.com/img/profile.gif", "comments": []}]`,
165165
InputOption: Options{UseShortStruct: true, Name: "json"},
166166
Expected: `type JSON struct {
@@ -183,7 +183,7 @@ type Post struct {
183183
Title string 'json:"title"'
184184
}`,
185185
},
186-
TestCase{
186+
{
187187
Input: `[{"post": {"status": 1, "accept_comment": true, "title": "hello world", "tags": [1,2,4]}, "categories": [{"name": "aws", "num": 123}, {"name": 123, "num": 3.14}], "url": "http://blog.yudppp.com", "profile_image_url": "http://blog.yudppp.com/img/profile.gif", "comments": []}]`,
188188
InputOption: Options{UseExample: true, Name: "json"},
189189
Expected: `type JSON struct {

playground/main.go

+15-15
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"strings"
55
"time"
66

7-
"github.com/gopherjs/vecty"
8-
"github.com/gopherjs/vecty/elem"
9-
"github.com/gopherjs/vecty/event"
10-
"github.com/gopherjs/vecty/prop"
7+
"github.com/hexops/vecty"
8+
"github.com/hexops/vecty/elem"
9+
"github.com/hexops/vecty/event"
10+
"github.com/hexops/vecty/prop"
1111
"github.com/yudppp/json2struct"
1212
)
1313

@@ -42,22 +42,22 @@ type PageView struct {
4242
}
4343

4444
// Render implements the vecty.Component interface.
45-
func (p *PageView) Render() *vecty.HTML {
45+
func (p *PageView) Render() vecty.ComponentOrHTML {
4646
return elem.Body(
4747
elem.Header(
48-
prop.Class("header"),
48+
vecty.Property("class", "header"),
4949
vecty.Text("json2struct playground"),
5050
),
5151
elem.Div(
52-
prop.Class("wrapper"),
52+
vecty.Property("class", "wrapper"),
5353
elem.Div(
54-
prop.Class("col input"),
54+
vecty.Property("class", "col input"),
5555
elem.Div(
5656
vecty.Tag("label",
5757
vecty.Text("input json"),
5858
),
5959
elem.TextArea(
60-
prop.Class("u-full-width"),
60+
vecty.Property("class", "u-full-width"),
6161
vecty.Text(p.Input),
6262
event.Input(func(e *vecty.Event) {
6363
p.Input = e.Target.Get("value").String()
@@ -109,7 +109,7 @@ func (p *PageView) Render() *vecty.HTML {
109109
vecty.Text("omitempty mode"),
110110
),
111111
elem.Input(
112-
prop.Class("toggle"),
112+
vecty.Property("class", "toggle"),
113113
prop.Type(prop.TypeCheckbox),
114114
prop.Checked(p.UseOmitempty),
115115
event.Change(func(e *vecty.Event) {
@@ -123,7 +123,7 @@ func (p *PageView) Render() *vecty.HTML {
123123
vecty.Text("short mode"),
124124
),
125125
elem.Input(
126-
prop.Class("toggle"),
126+
vecty.Property("class", "toggle"),
127127
prop.Type(prop.TypeCheckbox),
128128
prop.Checked(p.UseShortStruct),
129129
event.Change(func(e *vecty.Event) {
@@ -137,7 +137,7 @@ func (p *PageView) Render() *vecty.HTML {
137137
vecty.Text("local mode"),
138138
),
139139
elem.Input(
140-
prop.Class("toggle"),
140+
vecty.Property("class", "toggle"),
141141
prop.Type(prop.TypeCheckbox),
142142
prop.Checked(p.UseLocal),
143143
event.Change(func(e *vecty.Event) {
@@ -151,7 +151,7 @@ func (p *PageView) Render() *vecty.HTML {
151151
vecty.Text("example tag mode"),
152152
),
153153
elem.Input(
154-
prop.Class("toggle"),
154+
vecty.Property("class", "toggle"),
155155
prop.Type(prop.TypeCheckbox),
156156
prop.Checked(p.UseExampleTag),
157157
event.Change(func(e *vecty.Event) {
@@ -162,7 +162,7 @@ func (p *PageView) Render() *vecty.HTML {
162162
),
163163
),
164164
elem.Div(
165-
prop.Class("col output"),
165+
vecty.Property("class", "col output"),
166166
vecty.Tag("label",
167167
vecty.Text("output struct"),
168168
),
@@ -186,7 +186,7 @@ func (p *PageView) Render() *vecty.HTML {
186186
),
187187
),
188188
elem.Footer(
189-
prop.Class("footer"),
189+
vecty.Property("class", "footer"),
190190
vecty.Text("Used by "),
191191
elem.Anchor(
192192
prop.Href("https://github.com/yudppp/json2struct"),

vendor/github.com/c9s/inflect/LICENCE

-19
This file was deleted.

vendor/github.com/c9s/inflect/Makefile

-7
This file was deleted.

0 commit comments

Comments
 (0)