diff options
author | Ivan Sharavuev <shpiwan@gmail.com> | 2018-10-13 13:14:39 +0300 |
---|---|---|
committer | Iskander Sharipov <iskander.sharipov@intel.com> | 2018-10-13 11:17:13 +0000 |
commit | c4f07510a0161c4493a751984e24532a1b189759 (patch) | |
tree | b2fe53c495157b68c85e1f867fb9febf948a345d /src/strings | |
parent | b4150f76144808bf0015fe23be0e2ade32a14599 (diff) | |
download | go-c4f07510a0161c4493a751984e24532a1b189759.tar.gz go-c4f07510a0161c4493a751984e24532a1b189759.zip |
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>
Diffstat (limited to 'src/strings')
-rw-r--r-- | src/strings/replace.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/strings/replace.go b/src/strings/replace.go index 9ddf5e1e3f..ace0b8d646 100644 --- a/src/strings/replace.go +++ b/src/strings/replace.go @@ -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] |