(m uhaha.Machine, args []string)
| 51 | } |
| 52 | |
| 53 | func cmdHGET(m uhaha.Machine, args []string) (interface{}, error) { |
| 54 | if len(args) != 3 { |
| 55 | return nil, uhaha.ErrWrongNumArgs |
| 56 | } |
| 57 | val, err := ldb.HGet([]byte(args[1]), []byte(args[2])) |
| 58 | |
| 59 | if err != nil { |
| 60 | if err == leveldb.ErrNotFound { |
| 61 | return nil, nil |
| 62 | } |
| 63 | return nil, err |
| 64 | } |
| 65 | |
| 66 | // A missing field yields a nil slice; a field holding an empty value yields |
| 67 | // an empty one and must stay an empty bulk string rather than a nil reply. |
| 68 | if val == nil { |
| 69 | return nil, nil |
| 70 | } |
| 71 | |
| 72 | return val, nil |
| 73 | } |
| 74 |
nothing calls this directly
no outgoing calls
no test coverage detected