Skip to content

Commit 29035c7

Browse files
authored
Update go client README to match modern module support (#23292)
* Update go README to match modern module support Updated go client installation instructions to use go modules explicitly. * regenerate examples
1 parent 2893023 commit 29035c7

12 files changed

Lines changed: 12 additions & 104 deletions

File tree

modules/openapi-generator/src/main/resources/go/README.mustache

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
2020

2121
## Installation
2222

23-
Install the following dependencies:
24-
25-
```sh
26-
go get github.com/stretchr/testify/assert
27-
{{#hasOAuthMethods}}
28-
go get golang.org/x/oauth2
29-
{{/hasOAuthMethods}}
30-
go get golang.org/x/net/context
31-
```
32-
33-
Put the package under your project folder and add the following in import:
23+
Import the package in a go file in your project and run `go mod tidy`:
3424

3525
```go
3626
import {{packageName}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}"

samples/client/echo_api/go-external-refs/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
1212

1313
## Installation
1414

15-
Install the following dependencies:
16-
17-
```sh
18-
go get github.com/stretchr/testify/assert
19-
go get golang.org/x/net/context
20-
```
21-
22-
Put the package under your project folder and add the following in import:
15+
Import the package in a go file in your project and run `go mod tidy`:
2316

2417
```go
2518
import openapi "github.com/GIT_USER_ID/GIT_REPO_ID"

samples/client/echo_api/go/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
1212

1313
## Installation
1414

15-
Install the following dependencies:
16-
17-
```sh
18-
go get github.com/stretchr/testify/assert
19-
go get golang.org/x/net/context
20-
```
21-
22-
Put the package under your project folder and add the following in import:
15+
Import the package in a go file in your project and run `go mod tidy`:
2316

2417
```go
2518
import openapi "github.com/GIT_USER_ID/GIT_REPO_ID"

samples/client/others/go/allof_multiple_ref_and_discriminator/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
1212

1313
## Installation
1414

15-
Install the following dependencies:
16-
17-
```sh
18-
go get github.com/stretchr/testify/assert
19-
go get golang.org/x/net/context
20-
```
21-
22-
Put the package under your project folder and add the following in import:
15+
Import the package in a go file in your project and run `go mod tidy`:
2316

2417
```go
2518
import openapi "github.com/GIT_USER_ID/GIT_REPO_ID"

samples/client/others/go/oneof-anyof-required/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
1212

1313
## Installation
1414

15-
Install the following dependencies:
16-
17-
```sh
18-
go get github.com/stretchr/testify/assert
19-
go get golang.org/x/net/context
20-
```
21-
22-
Put the package under your project folder and add the following in import:
15+
Import the package in a go file in your project and run `go mod tidy`:
2316

2417
```go
2518
import openapi "github.com/GIT_USER_ID/GIT_REPO_ID"

samples/client/others/go/oneof-discriminator-lookup/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
1212

1313
## Installation
1414

15-
Install the following dependencies:
16-
17-
```sh
18-
go get github.com/stretchr/testify/assert
19-
go get golang.org/x/net/context
20-
```
21-
22-
Put the package under your project folder and add the following in import:
15+
Import the package in a go file in your project and run `go mod tidy`:
2316

2417
```go
2518
import openapi "github.com/GIT_USER_ID/GIT_REPO_ID"

samples/client/petstore/go/go-petstore/README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
1212

1313
## Installation
1414

15-
Install the following dependencies:
16-
17-
```sh
18-
go get github.com/stretchr/testify/assert
19-
go get golang.org/x/oauth2
20-
go get golang.org/x/net/context
21-
```
22-
23-
Put the package under your project folder and add the following in import:
15+
Import the package in a go file in your project and run `go mod tidy`:
2416

2517
```go
2618
import petstore "github.com/GIT_USER_ID/GIT_REPO_ID"

samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
1212

1313
## Installation
1414

15-
Install the following dependencies:
16-
17-
```sh
18-
go get github.com/stretchr/testify/assert
19-
go get golang.org/x/net/context
20-
```
21-
22-
Put the package under your project folder and add the following in import:
15+
Import the package in a go file in your project and run `go mod tidy`:
2316

2417
```go
2518
import x_auth_id_alias "github.com/GIT_USER_ID/GIT_REPO_ID"

samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
1212

1313
## Installation
1414

15-
Install the following dependencies:
16-
17-
```sh
18-
go get github.com/stretchr/testify/assert
19-
go get golang.org/x/oauth2
20-
go get golang.org/x/net/context
21-
```
22-
23-
Put the package under your project folder and add the following in import:
15+
Import the package in a go file in your project and run `go mod tidy`:
2416

2517
```go
2618
import petstore "github.com/GIT_USER_ID/GIT_REPO_ID"

samples/openapi3/client/petstore/go-petstore-withXml/README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
1212

1313
## Installation
1414

15-
Install the following dependencies:
16-
17-
```sh
18-
go get github.com/stretchr/testify/assert
19-
go get golang.org/x/oauth2
20-
go get golang.org/x/net/context
21-
```
22-
23-
Put the package under your project folder and add the following in import:
15+
Import the package in a go file in your project and run `go mod tidy`:
2416

2517
```go
2618
import petstore "github.com/GIT_USER_ID/GIT_REPO_ID"

0 commit comments

Comments
 (0)