diff options
| author | Daniel Martí <mvdan@mvdan.cc> | 2017-08-15 21:15:26 +0100 |
|---|---|---|
| committer | Daniel Martí <mvdan@mvdan.cc> | 2017-08-28 06:52:55 +0000 |
| commit | 5d39af9d9bac91b84b9944b1edffc6fb332747fa (patch) | |
| tree | 5569c6e045c8509b6e250fae3c41feb9cb5dc3dd /src/encoding/json/encode.go | |
| parent | 0c4d035ca884c9150ab4114922e29f457b45b996 (diff) | |
| download | go-5d39af9d9bac91b84b9944b1edffc6fb332747fa.tar.xz | |
all: remove some unused result params
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í <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/encoding/json/encode.go')
| -rw-r--r-- | src/encoding/json/encode.go | 8 |
1 files changed, 2 insertions, 6 deletions
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. |
