diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-11-22 22:18:48 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-11-22 22:18:48 -0500 |
commit | 640249036f58f79493c9c995f337fc9a2c67c6cb (patch) | |
tree | eec6ade0cde6b41d2626f777a1f1d312330b279b /cmd_comment.go | |
parent | c4e844f390aaeabfc3ffe4e28457c8d0c84e934e (diff) |
use an interface to avoid specifying *textproto.FIWriter everywhere
Diffstat (limited to 'cmd_comment.go')
-rw-r--r-- | cmd_comment.go | 8 |
1 files changed, 4 insertions, 4 deletions
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 { |