From fa3eed199843bbede4bedfe38e4908b8445bb60f Mon Sep 17 00:00:00 2001 From: greatroar <61184462+greatroar@users.noreply.github.com> Date: Sun, 1 Aug 2021 09:11:50 +0200 Subject: [PATCH] Use rclone.wrappedConn by pointer This shaves a kilobyte off the Linux binary by not generating a non-pointer interface implementation. --- internal/backend/rclone/backend.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/backend/rclone/backend.go b/internal/backend/rclone/backend.go index 9aa36c9d3..e1dbf656e 100644 --- a/internal/backend/rclone/backend.go +++ b/internal/backend/rclone/backend.go @@ -104,16 +104,16 @@ type wrappedConn struct { io.Writer } -func (c wrappedConn) Read(p []byte) (int, error) { +func (c *wrappedConn) Read(p []byte) (int, error) { return c.Reader.Read(p) } -func (c wrappedConn) Write(p []byte) (int, error) { +func (c *wrappedConn) Write(p []byte) (int, error) { return c.Writer.Write(p) } -func wrapConn(c *StdioConn, lim limiter.Limiter) wrappedConn { - wc := wrappedConn{ +func wrapConn(c *StdioConn, lim limiter.Limiter) *wrappedConn { + wc := &wrappedConn{ StdioConn: c, Reader: c, Writer: c,