From: Joe Tsai Date: Wed, 25 Jun 2025 03:35:36 +0000 (-0700) Subject: encoding/json/jsontext: remove Encoder.UnusedBuffer X-Git-Tag: go1.25rc2~2^2~26 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b5d555991a;p=gostls13.git encoding/json/jsontext: remove Encoder.UnusedBuffer WARNING: This commit contains a breaking change. This is permissible since jsontext is experimental and not subject to the Go 1 compatibility agreement. Existing callers of UnusedBuffer should use AvailableBuffer instead. Updates #71497 Change-Id: Ib080caf306d545a8fb038e57f0817b18dd0f91cf Reviewed-on: https://go-review.googlesource.com/c/go/+/683897 LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov Reviewed-by: Johan Brandhorst-Satzkorn Reviewed-by: Damien Neil Auto-Submit: Joseph Tsai --- diff --git a/src/encoding/json/jsontext/encode.go b/src/encoding/json/jsontext/encode.go index 1e0861e9f0..bb9a41f0f6 100644 --- a/src/encoding/json/jsontext/encode.go +++ b/src/encoding/json/jsontext/encode.go @@ -900,11 +900,6 @@ func (e *Encoder) OutputOffset() int64 { return e.s.previousOffsetEnd() } -// Deprecated: Use [Encoder.AvailableBuffer] instead. -func (e *Encoder) UnusedBuffer() []byte { - return e.AvailableBuffer() -} - // AvailableBuffer returns a zero-length buffer with a possible non-zero capacity. // This buffer is intended to be used to populate a [Value] // being passed to an immediately succeeding [Encoder.WriteValue] call.