mirror of https://github.com/tidwall/redcon.git
Cleanup test file
This commit is contained in:
parent
99f437a123
commit
730a465d73
16
redcon.go
16
redcon.go
|
@ -924,6 +924,22 @@ func (rd *Reader) readCommands(leftover *int) ([]Command, error) {
|
||||||
return rd.readCommands(leftover)
|
return rd.readCommands(leftover)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReadCommands reads the next pipeline commands.
|
||||||
|
func (rd *Reader) ReadCommands() ([]Command, error) {
|
||||||
|
for {
|
||||||
|
if len(rd.cmds) > 0 {
|
||||||
|
cmds := rd.cmds
|
||||||
|
rd.cmds = nil
|
||||||
|
return cmds, nil
|
||||||
|
}
|
||||||
|
cmds, err := rd.readCommands(nil)
|
||||||
|
if err != nil {
|
||||||
|
return []Command{}, err
|
||||||
|
}
|
||||||
|
rd.cmds = cmds
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ReadCommand reads the next command.
|
// ReadCommand reads the next command.
|
||||||
func (rd *Reader) ReadCommand() (Command, error) {
|
func (rd *Reader) ReadCommand() (Command, error) {
|
||||||
if len(rd.cmds) > 0 {
|
if len(rd.cmds) > 0 {
|
||||||
|
|
Loading…
Reference in New Issue