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_comment.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd_comment.go') diff --git a/cmd_comment.go b/cmd_comment.go index 6ce801c..d2aaccc 100644 --- a/cmd_comment.go +++ b/cmd_comment.go @@ -15,7 +15,7 @@ type CmdComment struct { } func (c CmdComment) fiCmdClass() cmdClass { return cmdClassComment } -func (c CmdComment) fiCmdWrite(fiw *textproto.FIWriter) error { +func (c CmdComment) fiCmdWrite(fiw fiWriter) error { return fiw.WriteLine("#" + c.Comment) } func init() { parser_registerCmd("#", CmdComment{}) } @@ -34,7 +34,7 @@ type CmdGetMark struct { } func (c CmdGetMark) fiCmdClass() cmdClass { return cmdClassComment } -func (c CmdGetMark) fiCmdWrite(fiw *textproto.FIWriter) error { +func (c CmdGetMark) fiCmdWrite(fiw fiWriter) error { return fiw.WriteLine("get-mark", ":"+strconv.Itoa(c.Mark)) } func init() { parser_registerCmd("get-mark :", CmdGetMark{}) } @@ -58,7 +58,7 @@ type CmdCatBlob struct { } func (c CmdCatBlob) fiCmdClass() cmdClass { return cmdClassComment } -func (c CmdCatBlob) fiCmdWrite(fiw *textproto.FIWriter) error { +func (c CmdCatBlob) fiCmdWrite(fiw fiWriter) error { return fiw.WriteLine("cat-blob", c.DataRef) } func init() { parser_registerCmd("cat-blob ", CmdCatBlob{}) } @@ -91,7 +91,7 @@ func (c CmdLs) fiCmdClass() cmdClass { } return cmdClassComment } -func (c CmdLs) fiCmdWrite(fiw *textproto.FIWriter) error { +func (c CmdLs) fiCmdWrite(fiw fiWriter) error { if c.DataRef == "" { return fiw.WriteLine("ls", c.Path) } else { -- cgit v1.2.3