Skip to content

Commit

Permalink
BREAKING CHANGE: all API calls now require a context.Context as a f…
Browse files Browse the repository at this point in the history
…irst

parameter, to allow for cancellation to propagate to long calls (or stalling
calls on nodes that are overloaded).

Just add a `ctx` that's hanging around, or use `context.Background()` when
you don't care.
  • Loading branch information
abourget committed Feb 27, 2020
1 parent b3b900d commit ef30f40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README-cn.md
Expand Up @@ -21,8 +21,8 @@ https://github.com/eoscanada/eos-bios
```go
api := eos.New("http://testnet1.eos.io")

infoResp, _ := api.GetInfo()
accountResp, _ := api.GetAccount("initn")
infoResp, _ := api.GetInfo(ctx)
accountResp, _ := api.GetAccount(ctx, "initn")
fmt.Println("Permission for initn:", accountResp.Permissions[0].RequiredAuth.Keys)
```

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -25,8 +25,8 @@ Basic usage
```go
api := eos.New("http://testnet1.eos.io")

infoResp, _ := api.GetInfo()
accountResp, _ := api.GetAccount("initn")
infoResp, _ := api.GetInfo(ctx)
accountResp, _ := api.GetAccount(ctx, "initn")
fmt.Println("Permission for initn:", accountResp.Permissions[0].RequiredAuth.Keys)
```

Expand Down

0 comments on commit ef30f40

Please sign in to comment.