(m uhaha.Machine, args []string)
| 376 | if err != nil { |
| 377 | return nil, err |
| 378 | } |
| 379 | |
| 380 | return redcon.SimpleInt(n), nil |
| 381 | } |
| 382 | |
| 383 | func cmdLINDEX(m uhaha.Machine, args []string) (interface{}, error) { |
| 384 | if len(args) != 3 { |
| 385 | return nil, uhaha.ErrWrongNumArgs |
| 386 | } |
| 387 | index, err := ledis.StrInt64([]byte(args[2]), nil) |
| 388 | if err != nil { |
| 389 | return nil, err |
| 390 | } |
| 391 | |
| 392 | v, err := ldb.LIndex([]byte(args[1]), int32(index)) |
| 393 | if err != nil { |
| 394 | return nil, err |
| 395 | } |
| 396 | |
| 397 | // return `(nil)` when out of range |
| 398 | if len(v) == 0 { |
| 399 | return nil, nil |
| 400 | } |
| 401 |
nothing calls this directly
no outgoing calls
no test coverage detected