]> Cypherpunks.ru repositories - gostls13.git/commitdiff
all: remove redundant returns
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 19 Apr 2017 19:38:10 +0000 (20:38 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 19 Apr 2017 20:03:51 +0000 (20:03 +0000)
Returns at the end of func bodies where the funcs have no return values
are pointless.

Change-Id: I0da5ea78671503e41a9f56dd770df8c919310ce5
Reviewed-on: https://go-review.googlesource.com/41093
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/bufio/scan_test.go
src/encoding/gob/codec_test.go
src/encoding/gob/error.go
src/go/printer/nodes.go
src/net/http/pprof/pprof.go
src/runtime/mgclarge.go
src/runtime/runtime_test.go
src/text/template/parse/parse.go

index 1bb1e8839325eee0b50c50b9f6e9d4244b30a391..25682256887daaa0b973e5660ef453ef80713488 100644 (file)
@@ -169,7 +169,6 @@ func genLine(buf *bytes.Buffer, lineNum, n int, addNewline bool) {
                }
                buf.WriteByte('\n')
        }
-       return
 }
 
 // Test the line splitter, including some carriage returns but no long lines.
index 31c6aa6dd701206543a4d342ad781d999e6d6a59..c1020595902c4cd66c5c6628029140c0c8e803ef 100644 (file)
@@ -47,7 +47,6 @@ func testError(t *testing.T) {
        if e := recover(); e != nil {
                t.Error(e.(gobError).err) // Will re-panic if not one of our errors, such as a runtime error.
        }
-       return
 }
 
 func newDecBuffer(data []byte) *decBuffer {
index 8b5265c278ff2ad99150f84344276f73ff45e40d..949333bc0370177b93eaad841b431dd39e5b5e89 100644 (file)
@@ -39,5 +39,4 @@ func catchError(err *error) {
                }
                *err = ge.err
        }
-       return
 }
index 08b8711c2d67c7cd8a599430ed58c49adf67fd97..bea4ff2a3adb6fa164070d28e76119d571f95720 100644 (file)
@@ -887,8 +887,6 @@ func (p *printer) expr1(expr ast.Expr, prec1, depth int) {
        default:
                panic("unreachable")
        }
-
-       return
 }
 
 func (p *printer) possibleSelectorExpr(expr ast.Expr, prec1, depth int) bool {
@@ -1268,8 +1266,6 @@ func (p *printer) stmt(stmt ast.Stmt, nextIsRBrace bool) {
        default:
                panic("unreachable")
        }
-
-       return
 }
 
 // ----------------------------------------------------------------------------
index 6930df531b42ce55e67d30baf7e8fe6bae3fa4f2..da153447df7788c6319b2be985216d3e44e753de 100644 (file)
@@ -230,7 +230,6 @@ func (name handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
                runtime.GC()
        }
        p.WriteTo(w, debug)
-       return
 }
 
 // Index responds with the pprof-formatted profile named by the request.
index 3c2b12fe8e3bb9de9b7fd0faaeb219cb3e156c5a..757e88d1d9da6ff6ca435c5cba15dd3603cf5af8 100644 (file)
@@ -240,7 +240,6 @@ func (root *mTreap) removeSpan(span *mspan) {
                }
        }
        root.removeNode(t)
-       return
 }
 
 // scavengetreap visits each node in the treap and scavenges the
index 666bc0a546d7f63ea8a5d31318da77127aa0da1e..e9bc2567123ac265ea1e8395a389bcf398d35119 100644 (file)
@@ -79,7 +79,6 @@ func defer1() {
                        panic("bad recover")
                }
        }(1, 2, 3)
-       return
 }
 
 func BenchmarkDefer10(b *testing.B) {
index 6060c6d74b7f69e8c650bf4823bcd4c9efe0d492..a91a544ce016f2c5446c441dcc30a3abf5d39966 100644 (file)
@@ -202,7 +202,6 @@ func (t *Tree) recover(errp *error) {
                }
                *errp = e.(error)
        }
-       return
 }
 
 // startParse initializes the parser, using the lexer.