]> Cypherpunks repositories - gostls13.git/commit
all: remove public named return values when useless
authorBrad Fitzpatrick <bradfitz@golang.org>
Sun, 28 Feb 2016 23:52:49 +0000 (15:52 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 29 Feb 2016 03:31:19 +0000 (03:31 +0000)
commit351c15f1cee364a91ef606ef9114d55247a6a0c2
tree8dcea615817f3a640786e55a4ebcfe75306abe77
parent28ce6f3600fd87a1ae39c492ee56307f0be3c32f
all: remove public named return values when useless

Named returned values should only be used on public funcs and methods
when it contributes to the documentation.

Named return values should not be used if they're only saving the
programmer a few lines of code inside the body of the function,
especially if that means there's stutter in the documentation or it
was only there so the programmer could use a naked return
statement. (Naked returns should not be used except in very small
functions)

This change is a manual audit & cleanup of public func signatures.

Signatures were not changed if:

* the func was private (wouldn't be in public godoc)
* the documentation referenced it
* the named return value was an interesting name. (i.e. it wasn't
  simply stutter, repeating the name of the type)

There should be no changes in behavior. (At least: none intended)

Change-Id: I3472ef49619678fe786e5e0994bdf2d9de76d109
Reviewed-on: https://go-review.googlesource.com/20024
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
40 files changed:
doc/effective_go.html
src/archive/zip/reader.go
src/bufio/bufio.go
src/bytes/buffer.go
src/bytes/reader.go
src/crypto/dsa/dsa.go
src/crypto/ecdsa/ecdsa.go
src/crypto/rsa/pkcs1v15.go
src/crypto/rsa/pss.go
src/crypto/rsa/rsa.go
src/crypto/tls/tls.go
src/crypto/x509/pkcs1.go
src/crypto/x509/sec1.go
src/crypto/x509/x509.go
src/debug/macho/fat.go
src/encoding/csv/writer.go
src/encoding/xml/xml.go
src/fmt/print.go
src/go/ast/print.go
src/go/build/build.go
src/go/types/check.go
src/go/types/eval.go
src/io/io.go
src/log/syslog/syslog.go
src/mime/multipart/formdata.go
src/net/http/request.go
src/net/unixsock_posix.go
src/net/url/url.go
src/os/doc.go
src/os/exec/lp_windows.go
src/strconv/atob.go
src/strconv/atof.go
src/strconv/atoi.go
src/strconv/quote.go
src/strings/reader.go
src/testing/quick/quick.go
src/text/tabwriter/tabwriter.go
src/text/template/exec.go
src/text/template/parse/parse.go
src/time/time.go