Skip to content

Commit 1a93257

Browse files
authored
Updated GO module clients generation (#88)
* Updated GO module clients generation * Updated go diff patch * Updated paths
1 parent 647c963 commit 1a93257

File tree

4 files changed

+64
-2
lines changed

4 files changed

+64
-2
lines changed

config/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ languages:
1717
- "{{version_output_dir}}"
1818
description: Copy shared assets in the generated folder
1919
templates:
20+
patches:
21+
- template-patches/go-mod.patch
22+
- template-patches/go-sum.patch
2023
source:
2124
type: openapi-git
2225
git_committish: "v7.0.0" # git committish to checkout before extracting the templates

config/languages/go_v2.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"gitUserId": "arduino",
33
"gitRepoId": "iot-client-go",
4-
"isGoSubmodule": false,
5-
"packageName": "iot",
4+
"isGoSubmodule": true,
5+
"packageName": "v2",
66
"packageVersion": "2.0.4",
77
"withGoCodegenComment": true
88
}

template-patches/go-mod.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/go/go.mod.mustache b/go/go.mod.mustache
2+
index 91cea277607..7d4d168ad6a 100644
3+
--- a/go/go.mod.mustache
4+
+++ b/go/go.mod.mustache
5+
@@ -1,12 +1,17 @@
6+
module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}
7+
8+
-go 1.18
9+
+go 1.19
10+
11+
require (
12+
- {{#hasOAuthMethods}}
13+
- golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558
14+
- {{/hasOAuthMethods}}
15+
+ github.com/stretchr/testify v1.9.0
16+
+ golang.org/x/oauth2 v0.21.0
17+
{{#withAWSV4Signature}}
18+
github.com/aws/aws-sdk-go v1.34.14
19+
{{/withAWSV4Signature}}
20+
)
21+
+
22+
+require (
23+
+ github.com/davecgh/go-spew v1.1.1 // indirect
24+
+ github.com/pmezard/go-difflib v1.0.0 // indirect
25+
+ gopkg.in/yaml.v3 v3.0.1 // indirect
26+
+)

template-patches/go-sum.patch

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
diff --git a/go/go.sum.mustache b/go/go.sum.mustache
2+
index d25a7530fd5..b644e9f419c 100644
3+
--- a/go/go.sum.mustache
4+
+++ b/go/go.sum.mustache
5+
@@ -1,15 +1,13 @@
6+
-cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
7+
-github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
8+
-github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
9+
-golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
10+
-golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg=
11+
-golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
12+
-{{#hasOAuthMethods}}
13+
-golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
14+
-golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
15+
-{{/hasOAuthMethods}}
16+
-golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
17+
-golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
18+
-golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
19+
-google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
20+
-google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
21+
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
22+
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
23+
+github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
24+
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
25+
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
26+
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
27+
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
28+
+golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
29+
+golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
30+
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
31+
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
32+
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
33+
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)