From 343a5d57bef82a124ae4a4e6667870591c41a2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Tue, 25 Feb 2025 19:09:31 +0900 Subject: [PATCH] chore: make lint happy --- pbuf/buffer.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pbuf/buffer.go b/pbuf/buffer.go index a6718ad..93dd842 100644 --- a/pbuf/buffer.go +++ b/pbuf/buffer.go @@ -2,7 +2,6 @@ package pbuf import ( "bytes" - "io" "unsafe" "github.com/fumiama/orbyte" @@ -31,26 +30,22 @@ type buffer struct { lastRead readOp // last read operation, so that Unread* can work correctly. } -func skip(w *bytes.Buffer, n int) (int, error) { +func skip(w *bytes.Buffer, n int) { if n == 0 { - return 0, nil + return } b := (*buffer)(unsafe.Pointer(w)) b.lastRead = opInvalid if len(b.buf) <= b.off { // Buffer is empty, reset to recover space. w.Reset() - if n == 0 { - return 0, nil - } - return 0, io.EOF + return } n = minnum(n, len(b.buf[b.off:])) b.off += n if n > 0 { b.lastRead = opRead } - return n, nil } // The readOp constants describe the last action performed on