internal/trace: fix recorder.Write return value for header-only buffers

Fix issue #77083

Change-Id: I9189d1e3a6efea8478224164e820f50c818abcd5
GitHub-Last-Rev: bb24cbda95
GitHub-Pull-Request: golang/go#77092
Reviewed-on: https://go-review.googlesource.com/c/go/+/734300
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Commit-Queue: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
jjpinto
2026-01-06 22:47:07 +00:00
committed by Go LUCI
parent f6ebd91129
commit d1e7f49e3d

View File

@@ -39,7 +39,7 @@ func (w *recorder) Write(b []byte) (n int, err error) {
w.headerReceived = true
}
if len(b) == n {
return 0, nil
return n, nil
}
ba, nb, err := readBatch(b[n:]) // Every write from the runtime is guaranteed to be a complete batch.
if err != nil {