Skip to content

Commit 952dc14

Browse files
committed
Update examples of Go client
1 parent 13ce634 commit 952dc14

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/generators/go/_README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func main() {
2424
if err != nil {
2525
// handle error with getting passport provider
2626
}
27-
projects, response, err := c.IamProjectApi.IamProjectList(p.Ctx(), nil) // getting IamProjectList using IamProjectApi struct
27+
projects, response, err := c.IamProjectApi.IamProjectList(p.Ctx()).Execute() // getting IamProjectList using IamProjectApi struct
2828

2929
if err != nil {
3030
// handle error with request
@@ -70,7 +70,7 @@ Then use `Ctx`, or `CtxWithError` method.
7070
`Ctx` method usage:
7171

7272
```go
73-
projects, response, err := c.IamProjectApi.IamProjectList(p.Ctx(), nil)
73+
projects, response, err := c.IamProjectApi.IamProjectList(p.Ctx()).Execute()
7474
// [...]
7575
```
7676

@@ -82,7 +82,7 @@ if err != nil {
8282
log.panic(err)
8383
}
8484

85-
projects, response, err := c.IamProjectApi.IamProjectList(p.Ctx(), nil)
85+
projects, response, err := c.IamProjectApi.IamProjectList(p.Ctx()).Execute()
8686
```
8787

8888
The difference between `Ctx` method and `CtxWithError` is that `Ctx` does not
@@ -105,7 +105,7 @@ func main() {
105105
for {
106106
time.Sleep(5 * time.Minute)
107107
// this will not work, since token will be invalid after 5 minutes
108-
projects, _, err := client.IamProjectApi.IamProjectList(ctx, nil)
108+
projects, _, err := client.IamProjectApi.IamProjectList(ctx).Execute()
109109
// [...]
110110
}
111111
}
@@ -115,7 +115,7 @@ func main() {
115115

116116
```go
117117
// [...]
118-
projects, _, err := client.IamProjectApi.IamProjectList(provider.Ctx(), nil)
118+
projects, _, err := client.IamProjectApi.IamProjectList(provider.Ctx()).Execute()
119119
```
120120

121121
### "Prefer" header

0 commit comments

Comments
 (0)