From 29c005aded55168631029f9b129ff812ff96f802 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 15 Nov 2017 16:19:23 -0500 Subject: more --- read.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'read.go') diff --git a/read.go b/read.go index cfe35c4..ea10885 100644 --- a/read.go +++ b/read.go @@ -23,33 +23,26 @@ func (p *Parser) GetCmd() (Cmd, error) { return nil, err } } - return p.cmd, nil + return <-p.cmd, nil } func (p *Parser) putSlice(slice []byte) error { -} - -func utSlice(fir *FIReader) (Cmd, error) { - slice, err := fir.PeekSlice() - if err != nil { - return nil, err - } if len(slice) < 1 { - return nil, UnsupportedCommand(slice) + return UnsupportedCommand(slice) } switch slice[0] { case '#': // comment case 'b': // blob case 'c': if len(slice) < 2 { - return nil, UnsupportedCommand(slice) + return UnsupportedCommand(slice) } switch slice[1] { case 'o': // commit case 'h': // checkpoint case 'a': // cat-blob default: - return nil, UnsupportedCommand(slice) + return UnsupportedCommand(slice) } case 'd': // done case 'f': // feature @@ -60,6 +53,7 @@ func utSlice(fir *FIReader) (Cmd, error) { case 'r': // reset case 't': // tag default: - return nil, UnsupportedCommand(slice) + return UnsupportedCommand(slice) } + return nil // TODO } -- cgit v1.2.3-2-g168b