Skip to content

Commit

Permalink
README: update basic usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
aviau committed Sep 15, 2024
1 parent 38a2cc9 commit 4294756
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ func main() {
os.Getenv("FLARE_API_KEY"),
)
resp, err := client.Get(
"/leaksdb/v2/sources", nil,
"/tokens/test", nil,
)
if err != nil {
fmt.Printf("failed to get sources: %s\n", err)
fmt.Printf("failed to test token: %s\n", err)
os.Exit(1)
}
defer resp.Body.Close()
if _, err := io.Copy(os.Stdout, resp.Body); err != nil {
fmt.Printf("failed to print sources: %s\n", err)
fmt.Printf("failed to print response: %s\n", err)
os.Exit(1)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ func main() {
os.Getenv("FLARE_API_KEY"),
)
resp, err := client.Get(
"/leaksdb/v2/sources", nil,
"/tokens/test", nil,
)
if err != nil {
fmt.Printf("failed to get sources: %s\n", err)
fmt.Printf("failed to test token: %s\n", err)
os.Exit(1)
}
defer resp.Body.Close()
if _, err := io.Copy(os.Stdout, resp.Body); err != nil {
fmt.Printf("failed to print sources: %s\n", err)
fmt.Printf("failed to print response: %s\n", err)
os.Exit(1)
}
}

0 comments on commit 4294756

Please sign in to comment.