]> git.feebdaed.xyz Git - 0xmirror/ebpf.git/commitdiff
fix: splitting the modification and the return statement (#1909)
authoryrpang <yrpang@outlook.com>
Mon, 24 Nov 2025 20:21:36 +0000 (04:21 +0800)
committerGitHub <noreply@github.com>
Mon, 24 Nov 2025 20:21:36 +0000 (21:21 +0100)
Signed-off-by: yrpang <yrpang@outlook.com>
ringbuf/reader.go

index fb9b1af22abaf443d33c9f14ba37f7e3db429f4c..0864f2ae1af7c1ef16d90a96a1a52bbb4b3aa821 100644 (file)
@@ -138,7 +138,8 @@ func (r *Reader) SetDeadline(t time.Time) {
 // See [ReadInto] for a more efficient version of this method.
 func (r *Reader) Read() (Record, error) {
        var rec Record
-       return rec, r.ReadInto(&rec)
+       err := r.ReadInto(&rec)
+       return rec, err
 }
 
 // ReadInto is like Read except that it allows reusing Record and associated buffers.