Guest User

Untitled

a guest
Oct 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. type Attrs struct {
  2. Secret string `redis:"secret"`
  3. RequireSecret string `redis:"requireSecret"`
  4. UserID string `redis:"userId"`
  5. }
  6.  
  7. type Attrs struct {
  8. Secret string `redis:"secret"`
  9. RequireSecret bool `redis:"requireSecret"`
  10. UserID string `redis:"userId"`
  11. }
  12.  
  13. values, err := redis.Values(c.Do("HGETALL", key))
  14. if err != nil {
  15. // handle error
  16. }
  17. var attrs Attrs
  18. err = redis.ScanStruct(values, &attrs)
  19. if err != nil {
  20. // handle error
  21. }
Add Comment
Please, Sign In to add comment