fix: test code

This commit is contained in:
Bogus Jung 2022-04-28 20:32:58 +09:00
parent 07e15d2876
commit 1fdcbf86bb
1 changed files with 8 additions and 6 deletions

View File

@ -198,13 +198,15 @@ func ExampleClient_SetEX() {
} }
func ExampleClient_HSet() { func ExampleClient_HSet() {
type Items struct { // Set "key" tag for hash key
Key1 string `json:"key1"` type ExampleUser struct {
Key2 string `json:"key2"` Name string `key:"name"`
Age int `key:"age"`
} }
items := Items{"field1", "field2"}
items := ExampleUser{"jane", 22}
err := rdb.HSet(ctx, "key", items).Err()
err := rdb.HSet(ctx, "user:1", items).Err()
if err != nil { if err != nil {
panic(err) panic(err)
} }