Skip to content

Commit

Permalink
Updated README.md replacing deprecated calls with corresponding new o…
Browse files Browse the repository at this point in the history
…nes (#498)
  • Loading branch information
oleksiypavlenko authored Nov 1, 2023
1 parent 5b245db commit 8ec1a2b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ import (
var authtoken = "" // Set your auth token here
func main() {
var opts pagerduty.ListEscalationPoliciesOptions
ctx := context.Background()
client := pagerduty.NewClient(authtoken)
eps, err := client.ListEscalationPolicies(opts)
var opts pagerduty.ListEscalationPoliciesOptions
eps, err := client.ListEscalationPoliciesWithContext(ctx, opts)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -105,8 +107,9 @@ import (
var authtoken = "" // Set your auth token here

func main() {
ctx := context.Background()
client := pagerduty.NewClient(authtoken)
user, err := client.GetUser("NOTREAL", pagerduty.GetUserOptions{})
user, err := client.GetUserWithContext(ctx, "NOTREAL", pagerduty.GetUserOptions{})
if err != nil {
var aerr pagerduty.APIError

Expand Down

0 comments on commit 8ec1a2b

Please sign in to comment.