1
0
mirror of https://github.com/golang/go synced 2024-11-23 16:50:06 -07:00

strings: Replace s[:] to s where s is a slice.

Change-Id: Ie7ba3f9ece9b0fc0e8a5c92fbae9c3b558815e4c
Reviewed-on: https://go-review.googlesource.com/c/141997
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Iskander Sharipov <iskander.sharipov@intel.com>
This commit is contained in:
Ivan Sharavuev 2018-10-13 13:14:39 +03:00 committed by Iskander Sharipov
parent b4150f7614
commit c4f07510a0

View File

@ -459,7 +459,7 @@ func (r *byteReplacer) WriteString(w io.Writer, s string) (n int, err error) {
buf := make([]byte, bufsize)
for len(s) > 0 {
ncopy := copy(buf, s[:])
ncopy := copy(buf, s)
s = s[ncopy:]
for i, b := range buf[:ncopy] {
buf[i] = r[b]