From 083efd5c32374afdbe994c546c87b0135cebd7e5 Mon Sep 17 00:00:00 2001 From: Louis Thibault Date: Sat, 1 Jun 2024 02:39:15 -0400 Subject: [PATCH] Remove unneeded bytes.Reader. --- system/socket.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system/socket.go b/system/socket.go index 3958e72..0357f3a 100644 --- a/system/socket.go +++ b/system/socket.go @@ -1,7 +1,6 @@ package system import ( - "bytes" context "context" "errors" "io" @@ -27,7 +26,7 @@ func (c SocketConfig) Build() (sock Socket) { type Socket struct { Deliver api.Function - Buffer io.Writer + Buffer io.Writer // bytes.Buffer } func (p Socket) Handle(ctx context.Context, call Proc_handle) error { @@ -40,7 +39,7 @@ func (p Socket) Handle(ctx context.Context, call Proc_handle) error { return err } - n, err := io.Copy(p.Buffer, bytes.NewReader(b)) + n, err := p.Buffer.Write(b) if err != nil { return err } else if n > math.MaxUint32 {