]> Cypherpunks repositories - gostls13.git/commit
encoding/json/jsontext: rename Encoder.UnusedBuffer as Encoder.AvailableBuffer
authorJoe Tsai <joetsai@digital-static.net>
Wed, 25 Jun 2025 03:30:29 +0000 (20:30 -0700)
committerJoseph Tsai <joetsai@digital-static.net>
Wed, 25 Jun 2025 20:56:35 +0000 (13:56 -0700)
commit0b4d2eab2f7a20917639f0025de39ce9f0198d9f
tree9ee21be3f0ee8589df64927141b46a465bc074b3
parentf8ccda2e0574c9ca5d92068852a34b463f87a85b
encoding/json/jsontext: rename Encoder.UnusedBuffer as Encoder.AvailableBuffer

This follows the precedent set by:

bufio.Writer.AvailableBuffer
bytes.Buffer.AvailableBuffer

both with methods that return a zero-length buffer that
is intended to only be used with a following Write call.

This keeps the older UnusedBuffer method around so that
at least one commit that has both methods for migration purposes.

Updates #71497

Change-Id: I3815f593e09f645280ae5ad9cbdd63a6c147123b
Reviewed-on: https://go-review.googlesource.com/c/go/+/683896
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/encoding/json/jsontext/encode.go
src/encoding/json/v2/arshal_inlined.go
src/encoding/json/v2_decode.go