]> Cypherpunks.ru repositories - gostls13.git/commit
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)
committerIan Lance Taylor <iant@golang.org>
Mon, 28 Mar 2022 22:06:49 +0000 (22:06 +0000)
commit32fdad19a246143ae4f194d1b39886d778de1380
tree72e204d9e129ad64c328fd3fff9eb51058919884
parent460fd63cccd2f1d16fc4b1b761545b1649e14e28
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.

Fixes #51793

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>
src/bytes/bytes.go
src/bytes/bytes_test.go