From 640249036f58f79493c9c995f337fc9a2c67c6cb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 22 Nov 2017 22:18:48 -0500 Subject: use an interface to avoid specifying *textproto.FIWriter everywhere --- cmd.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cmd.go') diff --git a/cmd.go b/cmd.go index 5e76708..4d56ad8 100644 --- a/cmd.go +++ b/cmd.go @@ -1,14 +1,15 @@ package libfastimport -import ( - "git.lukeshu.com/go/libfastimport/textproto" -) - type fiReader interface { PeekLine() (string, error) ReadLine() (string, error) } +type fiWriter interface { + WriteData(string) error + WriteLine(a ...interface{}) error +} + type cmdClass int const ( @@ -20,6 +21,6 @@ const ( type Cmd interface { fiCmdRead(fiReader) (Cmd, error) - fiCmdWrite(*textproto.FIWriter) error + fiCmdWrite(fiWriter) error fiCmdClass() cmdClass } -- cgit v1.2.3