MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / cmdLPUSH

Function cmdLPUSH

lists.go:361–376  ·  view source on GitHub ↗
(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

359 v, err := ldb.RPop([]byte(args[1]))
360 if err != nil {
361 return nil, err
362 }
363 return v, nil
364}
365
366func cmdLPUSH(m uhaha.Machine, args []string) (interface{}, error) {
367 if len(args) < 3 {
368 return nil, uhaha.ErrWrongNumArgs
369 }
370
371 argList := make([][]byte, len(args)-2)
372 for i := 2; i < len(args); i++ {
373 argList[i-2] = []byte(args[i])
374 }
375 n, err := ldb.LPush([]byte(args[1]), argList...)
376 if err != nil {
377 return nil, err
378 }
379

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected