Skip to content

Commit

Permalink
Using INCR as an atomic operation
Browse files Browse the repository at this point in the history
  • Loading branch information
rayalex committed Aug 4, 2017
1 parent a8ee441 commit 165f47f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ func ExampleClient_Set() {
}

func ExampleClient_Incr() {
if err := client.Incr("counter").Err(); err != nil {
result, err := client.Incr("counter").Result()
if err != nil {
panic(err)
}

n, err := client.Get("counter").Int64()
fmt.Println(n, err)
// Output: 1 <nil>
fmt.Println(result)
// Output: 1
}

func ExampleClient_BLPop() {
Expand Down

0 comments on commit 165f47f

Please sign in to comment.