Skip to content

Commit

Permalink
fix: test code
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdqhry committed Apr 28, 2022
1 parent 07e15d2 commit 1fdcbf8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,15 @@ func ExampleClient_SetEX() {
}

func ExampleClient_HSet() {
type Items struct {
Key1 string `json:"key1"`
Key2 string `json:"key2"`
// Set "key" tag for hash key
type ExampleUser struct {
Name string `key:"name"`
Age int `key:"age"`
}
items := Items{"field1", "field2"}

err := rdb.HSet(ctx, "key", items).Err()

items := ExampleUser{"jane", 22}

err := rdb.HSet(ctx, "user:1", items).Err()
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 1fdcbf8

Please sign in to comment.