Skip to content

Commit 25c1616

Browse files
committed
chore(deps): updated dependencies & relinted
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent 5b01476 commit 25c1616

15 files changed

+101
-104
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ linters:
1717
- gomoddirectives
1818
- gosmopolitan
1919
- inamedparam
20-
- intrange # disabled while < go1.22
20+
#- intrange # disabled while < go1.22
2121
- ireturn
2222
- lll
2323
- musttag

benchmark_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func Benchmark_KubernetesSpec(b *testing.B) {
1919
b.ResetTimer()
2020
b.ReportAllocs()
2121

22-
for i := 0; i < b.N; i++ {
22+
for b.Loop() {
2323
validator := NewSpecValidator(doc.Schema(), strfmt.Default)
2424
validator.Options.SkipSchemataResult = true
2525
res, _ := validator.Validate(doc)

context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func WithOperationRequest(ctx context.Context) context.Context {
2727
return withOperation(ctx, request)
2828
}
2929

30-
// WithOperationRequest returns a new context with operationType response
30+
// WithOperationResponse returns a new context with operationType response
3131
// in context value
3232
func WithOperationResponse(ctx context.Context) context.Context {
3333
return withOperation(ctx, response)

go.mod

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
module github.com/go-openapi/validate
22

33
require (
4-
github.com/davecgh/go-spew v1.1.1
5-
github.com/go-openapi/analysis v0.23.0
6-
github.com/go-openapi/errors v0.22.2
7-
github.com/go-openapi/jsonpointer v0.22.0
8-
github.com/go-openapi/loads v0.22.0
9-
github.com/go-openapi/spec v0.21.0
10-
github.com/go-openapi/strfmt v0.23.0
11-
github.com/go-openapi/swag/conv v0.25.0
12-
github.com/go-openapi/swag/fileutils v0.25.0
13-
github.com/go-openapi/swag/jsonutils v0.25.0
14-
github.com/go-openapi/swag/stringutils v0.25.0
4+
github.com/go-openapi/analysis v0.24.0
5+
github.com/go-openapi/errors v0.22.3
6+
github.com/go-openapi/jsonpointer v0.22.1
7+
github.com/go-openapi/loads v0.23.1
8+
github.com/go-openapi/spec v0.22.0
9+
github.com/go-openapi/strfmt v0.24.0
10+
github.com/go-openapi/swag/conv v0.25.1
11+
github.com/go-openapi/swag/fileutils v0.25.1
12+
github.com/go-openapi/swag/jsonutils v0.25.1
13+
github.com/go-openapi/swag/stringutils v0.25.1
1514
github.com/stretchr/testify v1.11.1
16-
gopkg.in/yaml.v3 v3.0.1
15+
go.yaml.in/yaml/v3 v3.0.4
1716
)
1817

1918
require (
2019
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
21-
github.com/go-openapi/jsonreference v0.21.1 // indirect
22-
github.com/go-openapi/swag v0.24.1 // indirect
23-
github.com/go-openapi/swag/cmdutils v0.24.0 // indirect
24-
github.com/go-openapi/swag/jsonname v0.24.0 // indirect
25-
github.com/go-openapi/swag/loading v0.24.0 // indirect
26-
github.com/go-openapi/swag/mangling v0.24.0 // indirect
27-
github.com/go-openapi/swag/netutils v0.24.0 // indirect
28-
github.com/go-openapi/swag/typeutils v0.25.0 // indirect
29-
github.com/go-openapi/swag/yamlutils v0.24.0 // indirect
20+
github.com/davecgh/go-spew v1.1.1 // indirect
21+
github.com/go-openapi/jsonreference v0.21.2 // indirect
22+
github.com/go-openapi/swag/jsonname v0.25.1 // indirect
23+
github.com/go-openapi/swag/loading v0.25.1 // indirect
24+
github.com/go-openapi/swag/mangling v0.25.1 // indirect
25+
github.com/go-openapi/swag/typeutils v0.25.1 // indirect
26+
github.com/go-openapi/swag/yamlutils v0.25.1 // indirect
27+
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
3028
github.com/google/uuid v1.6.0 // indirect
31-
github.com/mitchellh/mapstructure v1.5.0 // indirect
3229
github.com/oklog/ulid v1.3.1 // indirect
3330
github.com/pmezard/go-difflib v1.0.0 // indirect
3431
go.mongodb.org/mongo-driver v1.17.4 // indirect
32+
golang.org/x/net v0.44.0 // indirect
33+
golang.org/x/text v0.29.0 // indirect
34+
gopkg.in/yaml.v3 v3.0.1 // indirect
3535
)
3636

3737
go 1.24.0

go.sum

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,42 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d
22
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
33
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
44
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5-
github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU=
6-
github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo=
7-
github.com/go-openapi/errors v0.22.2 h1:rdxhzcBUazEcGccKqbY1Y7NS8FDcMyIRr0934jrYnZg=
8-
github.com/go-openapi/errors v0.22.2/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0=
9-
github.com/go-openapi/jsonpointer v0.22.0 h1:TmMhghgNef9YXxTu1tOopo+0BGEytxA+okbry0HjZsM=
10-
github.com/go-openapi/jsonpointer v0.22.0/go.mod h1:xt3jV88UtExdIkkL7NloURjRQjbeUgcxFblMjq2iaiU=
11-
github.com/go-openapi/jsonreference v0.21.1 h1:bSKrcl8819zKiOgxkbVNRUBIr6Wwj9KYrDbMjRs0cDA=
12-
github.com/go-openapi/jsonreference v0.21.1/go.mod h1:PWs8rO4xxTUqKGu+lEvvCxD5k2X7QYkKAepJyCmSTT8=
13-
github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco=
14-
github.com/go-openapi/loads v0.22.0/go.mod h1:yLsaTCS92mnSAZX5WWoxszLj0u+Ojl+Zs5Stn1oF+rs=
15-
github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
16-
github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
17-
github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c=
18-
github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4=
19-
github.com/go-openapi/swag v0.24.1 h1:DPdYTZKo6AQCRqzwr/kGkxJzHhpKxZ9i/oX0zag+MF8=
20-
github.com/go-openapi/swag v0.24.1/go.mod h1:sm8I3lCPlspsBBwUm1t5oZeWZS0s7m/A+Psg0ooRU0A=
21-
github.com/go-openapi/swag/cmdutils v0.24.0 h1:KlRCffHwXFI6E5MV9n8o8zBRElpY4uK4yWyAMWETo9I=
22-
github.com/go-openapi/swag/cmdutils v0.24.0/go.mod h1:uxib2FAeQMByyHomTlsP8h1TtPd54Msu2ZDU/H5Vuf8=
23-
github.com/go-openapi/swag/conv v0.25.0 h1:5K+e44HkOgCVE0IJTbivurzHahT62DPr2DEJqR/+4pA=
24-
github.com/go-openapi/swag/conv v0.25.0/go.mod h1:oa1ZZnb1jubNdZlD1iAhGXt6Ic4hHtuO23MwTgAXR88=
25-
github.com/go-openapi/swag/fileutils v0.25.0 h1:t7aQRuRfsP29dY4vfrNvDZv7RurwRHuyjUedtYVDmYY=
26-
github.com/go-openapi/swag/fileutils v0.25.0/go.mod h1:+NXtt5xNZZqmpIpjqcujqojGFek9/w55b3ecmOdtg8M=
27-
github.com/go-openapi/swag/jsonname v0.24.0 h1:2wKS9bgRV/xB8c62Qg16w4AUiIrqqiniJFtZGi3dg5k=
28-
github.com/go-openapi/swag/jsonname v0.24.0/go.mod h1:GXqrPzGJe611P7LG4QB9JKPtUZ7flE4DOVechNaDd7Q=
29-
github.com/go-openapi/swag/jsonutils v0.25.0 h1:ELKpJT29T4N/AvmDqMeDFLx2QRZQOYFthzctbIX30+A=
30-
github.com/go-openapi/swag/jsonutils v0.25.0/go.mod h1:KYL8GyGoi6tek9ajpvn0le4BWmKoUVVv8yPxklViIMo=
31-
github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.0 h1:ca9vKxLnJegL2bzqXRWNabKdqVGxBzrnO8/UZnr5W0Y=
32-
github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.0/go.mod h1:kjmweouyPwRUEYMSrbAidoLMGeJ5p6zdHi9BgZiqmsg=
33-
github.com/go-openapi/swag/loading v0.24.0 h1:ln/fWTwJp2Zkj5DdaX4JPiddFC5CHQpvaBKycOlceYc=
34-
github.com/go-openapi/swag/loading v0.24.0/go.mod h1:gShCN4woKZYIxPxbfbyHgjXAhO61m88tmjy0lp/LkJk=
35-
github.com/go-openapi/swag/mangling v0.24.0 h1:PGOQpViCOUroIeak/Uj/sjGAq9LADS3mOyjznmHy2pk=
36-
github.com/go-openapi/swag/mangling v0.24.0/go.mod h1:Jm5Go9LHkycsz0wfoaBDkdc4CkpuSnIEf62brzyCbhc=
37-
github.com/go-openapi/swag/netutils v0.24.0 h1:Bz02HRjYv8046Ycg/w80q3g9QCWeIqTvlyOjQPDjD8w=
38-
github.com/go-openapi/swag/netutils v0.24.0/go.mod h1:WRgiHcYTnx+IqfMCtu0hy9oOaPR0HnPbmArSRN1SkZM=
39-
github.com/go-openapi/swag/stringutils v0.25.0 h1:iYfCF45GUeI/1Yrh8rQtTFCp5K1ToqWhUdzJZwvXvv8=
40-
github.com/go-openapi/swag/stringutils v0.25.0/go.mod h1:JLdSAq5169HaiDUbTvArA2yQxmgn4D6h4A+4HqVvAYg=
41-
github.com/go-openapi/swag/typeutils v0.25.0 h1:iUTsxu3F3h9v6CBzVFGXKPSBQt6d8XXgYy1YAlu+HJ8=
42-
github.com/go-openapi/swag/typeutils v0.25.0/go.mod h1:9McMC/oCdS4BKwk2shEB7x17P6HmMmA6dQRtAkSnNb8=
43-
github.com/go-openapi/swag/yamlutils v0.24.0 h1:bhw4894A7Iw6ne+639hsBNRHg9iZg/ISrOVr+sJGp4c=
44-
github.com/go-openapi/swag/yamlutils v0.24.0/go.mod h1:DpKv5aYuaGm/sULePoeiG8uwMpZSfReo1HR3Ik0yaG8=
5+
github.com/go-openapi/analysis v0.24.0 h1:vE/VFFkICKyYuTWYnplQ+aVr45vlG6NcZKC7BdIXhsA=
6+
github.com/go-openapi/analysis v0.24.0/go.mod h1:GLyoJA+bvmGGaHgpfeDh8ldpGo69fAJg7eeMDMRCIrw=
7+
github.com/go-openapi/errors v0.22.3 h1:k6Hxa5Jg1TUyZnOwV2Lh81j8ayNw5VVYLvKrp4zFKFs=
8+
github.com/go-openapi/errors v0.22.3/go.mod h1:+WvbaBBULWCOna//9B9TbLNGSFOfF8lY9dw4hGiEiKQ=
9+
github.com/go-openapi/jsonpointer v0.22.1 h1:sHYI1He3b9NqJ4wXLoJDKmUmHkWy/L7rtEo92JUxBNk=
10+
github.com/go-openapi/jsonpointer v0.22.1/go.mod h1:pQT9OsLkfz1yWoMgYFy4x3U5GY5nUlsOn1qSBH5MkCM=
11+
github.com/go-openapi/jsonreference v0.21.2 h1:Wxjda4M/BBQllegefXrY/9aq1fxBA8sI5M/lFU6tSWU=
12+
github.com/go-openapi/jsonreference v0.21.2/go.mod h1:pp3PEjIsJ9CZDGCNOyXIQxsNuroxm8FAJ/+quA0yKzQ=
13+
github.com/go-openapi/loads v0.23.1 h1:H8A0dX2KDHxDzc797h0+uiCZ5kwE2+VojaQVaTlXvS0=
14+
github.com/go-openapi/loads v0.23.1/go.mod h1:hZSXkyACCWzWPQqizAv/Ye0yhi2zzHwMmoXQ6YQml44=
15+
github.com/go-openapi/spec v0.22.0 h1:xT/EsX4frL3U09QviRIZXvkh80yibxQmtoEvyqug0Tw=
16+
github.com/go-openapi/spec v0.22.0/go.mod h1:K0FhKxkez8YNS94XzF8YKEMULbFrRw4m15i2YUht4L0=
17+
github.com/go-openapi/strfmt v0.24.0 h1:dDsopqbI3wrrlIzeXRbqMihRNnjzGC+ez4NQaAAJLuc=
18+
github.com/go-openapi/strfmt v0.24.0/go.mod h1:Lnn1Bk9rZjXxU9VMADbEEOo7D7CDyKGLsSKekhFr7s4=
19+
github.com/go-openapi/swag/conv v0.25.1 h1:+9o8YUg6QuqqBM5X6rYL/p1dpWeZRhoIt9x7CCP+he0=
20+
github.com/go-openapi/swag/conv v0.25.1/go.mod h1:Z1mFEGPfyIKPu0806khI3zF+/EUXde+fdeksUl2NiDs=
21+
github.com/go-openapi/swag/fileutils v0.25.1 h1:rSRXapjQequt7kqalKXdcpIegIShhTPXx7yw0kek2uU=
22+
github.com/go-openapi/swag/fileutils v0.25.1/go.mod h1:+NXtt5xNZZqmpIpjqcujqojGFek9/w55b3ecmOdtg8M=
23+
github.com/go-openapi/swag/jsonname v0.25.1 h1:Sgx+qbwa4ej6AomWC6pEfXrA6uP2RkaNjA9BR8a1RJU=
24+
github.com/go-openapi/swag/jsonname v0.25.1/go.mod h1:71Tekow6UOLBD3wS7XhdT98g5J5GR13NOTQ9/6Q11Zo=
25+
github.com/go-openapi/swag/jsonutils v0.25.1 h1:AihLHaD0brrkJoMqEZOBNzTLnk81Kg9cWr+SPtxtgl8=
26+
github.com/go-openapi/swag/jsonutils v0.25.1/go.mod h1:JpEkAjxQXpiaHmRO04N1zE4qbUEg3b7Udll7AMGTNOo=
27+
github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.1 h1:DSQGcdB6G0N9c/KhtpYc71PzzGEIc/fZ1no35x4/XBY=
28+
github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.1/go.mod h1:kjmweouyPwRUEYMSrbAidoLMGeJ5p6zdHi9BgZiqmsg=
29+
github.com/go-openapi/swag/loading v0.25.1 h1:6OruqzjWoJyanZOim58iG2vj934TysYVptyaoXS24kw=
30+
github.com/go-openapi/swag/loading v0.25.1/go.mod h1:xoIe2EG32NOYYbqxvXgPzne989bWvSNoWoyQVWEZicc=
31+
github.com/go-openapi/swag/mangling v0.25.1 h1:XzILnLzhZPZNtmxKaz/2xIGPQsBsvmCjrJOWGNz/ync=
32+
github.com/go-openapi/swag/mangling v0.25.1/go.mod h1:CdiMQ6pnfAgyQGSOIYnZkXvqhnnwOn997uXZMAd/7mQ=
33+
github.com/go-openapi/swag/stringutils v0.25.1 h1:Xasqgjvk30eUe8VKdmyzKtjkVjeiXx1Iz0zDfMNpPbw=
34+
github.com/go-openapi/swag/stringutils v0.25.1/go.mod h1:JLdSAq5169HaiDUbTvArA2yQxmgn4D6h4A+4HqVvAYg=
35+
github.com/go-openapi/swag/typeutils v0.25.1 h1:rD/9HsEQieewNt6/k+JBwkxuAHktFtH3I3ysiFZqukA=
36+
github.com/go-openapi/swag/typeutils v0.25.1/go.mod h1:9McMC/oCdS4BKwk2shEB7x17P6HmMmA6dQRtAkSnNb8=
37+
github.com/go-openapi/swag/yamlutils v0.25.1 h1:mry5ez8joJwzvMbaTGLhw8pXUnhDK91oSJLDPF1bmGk=
38+
github.com/go-openapi/swag/yamlutils v0.25.1/go.mod h1:cm9ywbzncy3y6uPm/97ysW8+wZ09qsks+9RS8fLWKqg=
39+
github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=
40+
github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
4541
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
4642
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
4743
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@@ -50,8 +46,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
5046
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
5147
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
5248
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
53-
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
54-
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
5549
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
5650
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
5751
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -64,6 +58,10 @@ go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFX
6458
go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
6559
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
6660
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
61+
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
62+
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
63+
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
64+
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
6765
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
6866
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
6967
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

messages_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/go-openapi/strfmt"
2828
"github.com/stretchr/testify/assert"
2929
"github.com/stretchr/testify/require"
30-
"gopkg.in/yaml.v3"
30+
yaml "go.yaml.in/yaml/v3"
3131
)
3232

3333
var (

pools_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func Test_ParallelPool(t *testing.T) {
1616
fixture3 := filepath.Join("fixtures", "bugs", "43", "fixture-43.yaml")
1717

1818
t.Run("should validate in parallel", func(t *testing.T) {
19-
for i := 0; i < 20; i++ {
19+
for range 20 {
2020
t.Run("validating fixture 1", func(t *testing.T) {
2121
t.Parallel()
2222

post/defaulter_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestDefaulter(t *testing.T) {
4242

4343
ApplyDefaults(r)
4444
t.Logf("After: %v", x)
45-
var expected interface{}
45+
var expected any
4646
err = json.Unmarshal([]byte(`{
4747
"existing": 100,
4848
"int": 42,
@@ -75,14 +75,14 @@ func TestDefaulterSimple(t *testing.T) {
7575
},
7676
}
7777
validator := validate.NewSchemaValidator(&schema, nil, "", strfmt.Default)
78-
x := map[string]interface{}{}
78+
x := make(map[string]any)
7979
t.Logf("Before: %v", x)
8080
r := validator.Validate(x)
8181
assert.Falsef(t, r.HasErrors(), "unexpected validation error: %v", r.AsError())
8282

8383
ApplyDefaults(r)
8484
t.Logf("After: %v", x)
85-
var expected interface{}
85+
var expected any
8686
err := json.Unmarshal([]byte(`{
8787
"int": 42,
8888
"str": "Hello"
@@ -97,7 +97,7 @@ func BenchmarkDefaulting(b *testing.B) {
9797
schema, err := defaulterFixture()
9898
require.NoError(b, err)
9999

100-
for n := 0; n < b.N; n++ {
100+
for b.Loop() {
101101
validator := validate.NewSchemaValidator(schema, nil, "", strfmt.Default)
102102
x := defaulterFixtureInput()
103103
r := validator.Validate(x)
@@ -106,13 +106,13 @@ func BenchmarkDefaulting(b *testing.B) {
106106
}
107107
}
108108

109-
func defaulterFixtureInput() map[string]interface{} {
110-
return map[string]interface{}{
109+
func defaulterFixtureInput() map[string]any {
110+
return map[string]any{
111111
"existing": float64(100),
112-
"nested": map[string]interface{}{},
113-
"all": map[string]interface{}{},
114-
"any": map[string]interface{}{},
115-
"one": map[string]interface{}{},
112+
"nested": map[string]any{},
113+
"all": map[string]any{},
114+
"any": map[string]any{},
115+
"one": map[string]any{},
116116
}
117117
}
118118

result.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ func (s *schemata) Slice() []*spec.Schema {
518518
return s.multiple
519519
}
520520

521-
// appendSchemata appends the schemata in other to s. It mutates s in-place.
521+
// Append appends the schemata in other to s. It mutates s in-place.
522522
func (s *schemata) Append(other schemata) {
523523
if other.one == nil && len(other.multiple) == 0 {
524524
return
@@ -560,7 +560,7 @@ func (s schemata) Clone() schemata {
560560

561561
if len(s.multiple) > 0 {
562562
clone.multiple = make([]*spec.Schema, len(s.multiple))
563-
for idx := 0; idx < len(s.multiple); idx++ {
563+
for idx := range len(s.multiple) {
564564
sp := new(spec.Schema)
565565
*sp = *s.multiple[idx]
566566
clone.multiple[idx] = sp

rexp_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestRace_compileRegexp(t *testing.T) {
7575
assert.IsType(t, vrex, rex)
7676
}
7777

78-
for i := 0; i < 20; i++ {
78+
for i := range 20 {
7979
ii := i
8080
t.Run(patterns[ii%3], func(t *testing.T) {
8181
t.Parallel()
@@ -99,7 +99,7 @@ func TestRace_mustCompileRegexp(t *testing.T) {
9999
assert.IsType(t, vrex, rex)
100100
}
101101

102-
for i := 0; i < 20; i++ {
102+
for i := range 20 {
103103
ii := i
104104
t.Run(patterns[ii%3], func(t *testing.T) {
105105
t.Parallel()

0 commit comments

Comments
 (0)