From 5d39af9d9bac91b84b9944b1edffc6fb332747fa Mon Sep 17 00:00:00 2001 From: Daniel Martí Date: Tue, 15 Aug 2017 21:15:26 +0100 Subject: all: remove some unused result params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most of these are return values that were part of a receiving parameter, so they're still accessible. A few others are not, but those have never had a use. Found with github.com/mvdan/unparam, after Kevin Burke's suggestion that the tool should also warn about unused result parameters. Change-Id: Id8b5ed89912a99db22027703a88bd94d0b292b8b Reviewed-on: https://go-review.googlesource.com/55910 Run-TryBot: Daniel Martí TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/encoding/json/encode.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/encoding/json/encode.go') diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go index 0371f0a24d..141b23c6c6 100644 --- a/src/encoding/json/encode.go +++ b/src/encoding/json/encode.go @@ -871,8 +871,7 @@ func (w *reflectWithString) resolve() error { } // NOTE: keep in sync with stringBytes below. -func (e *encodeState) string(s string, escapeHTML bool) int { - len0 := e.Len() +func (e *encodeState) string(s string, escapeHTML bool) { e.WriteByte('"') start := 0 for i := 0; i < len(s); { @@ -944,12 +943,10 @@ func (e *encodeState) string(s string, escapeHTML bool) int { e.WriteString(s[start:]) } e.WriteByte('"') - return e.Len() - len0 } // NOTE: keep in sync with string above. -func (e *encodeState) stringBytes(s []byte, escapeHTML bool) int { - len0 := e.Len() +func (e *encodeState) stringBytes(s []byte, escapeHTML bool) { e.WriteByte('"') start := 0 for i := 0; i < len(s); { @@ -1021,7 +1018,6 @@ func (e *encodeState) stringBytes(s []byte, escapeHTML bool) int { e.Write(s[start:]) } e.WriteByte('"') - return e.Len() - len0 } // A field represents a single field found in a struct. -- cgit v1.3