]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.18] bytes: restore old Trim/TrimLeft behavior for nil
authorIan Lance Taylor <iant@golang.org>
Fri, 18 Mar 2022 19:14:20 +0000 (12:14 -0700)
committerHeschi Kreinick <heschi@google.com>
Wed, 30 Mar 2022 16:42:29 +0000 (16:42 +0000)
commit8b0583a05441b84a99d03daa78a24306c85cddd3
treecf9a056c55ecddd4af6a7fbf752a98d2f0ae55ae
parent677c6fe94c69b4fa35503e4afd36e8ef0e1394c5
[release-branch.go1.18] bytes: restore old Trim/TrimLeft behavior for nil

Keep returning nil for the cases where we historically returned nil,
even though this is slightly different for TrimLeft and TrimRight.

For #51793
Fixes #51796

Change-Id: Ifbdfc6b09d52b8e063cfe6341019f9b2eb8b70e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/393876
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit 32fdad19a246143ae4f194d1b39886d778de1380)
Reviewed-on: https://go-review.googlesource.com/c/go/+/396294
Reviewed-by: Austin Clements <austin@google.com>
src/bytes/bytes.go
src/bytes/bytes_test.go