Commit ff7994ac authored by Daniel Martí's avatar Daniel Martí Committed by Brad Fitzpatrick

all: remove redundant returns

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 78510bd1
...@@ -169,7 +169,6 @@ func genLine(buf *bytes.Buffer, lineNum, n int, addNewline bool) { ...@@ -169,7 +169,6 @@ func genLine(buf *bytes.Buffer, lineNum, n int, addNewline bool) {
} }
buf.WriteByte('\n') buf.WriteByte('\n')
} }
return
} }
// Test the line splitter, including some carriage returns but no long lines. // Test the line splitter, including some carriage returns but no long lines.
......
...@@ -47,7 +47,6 @@ func testError(t *testing.T) { ...@@ -47,7 +47,6 @@ func testError(t *testing.T) {
if e := recover(); e != nil { if e := recover(); e != nil {
t.Error(e.(gobError).err) // Will re-panic if not one of our errors, such as a runtime error. 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 { func newDecBuffer(data []byte) *decBuffer {
......
...@@ -39,5 +39,4 @@ func catchError(err *error) { ...@@ -39,5 +39,4 @@ func catchError(err *error) {
} }
*err = ge.err *err = ge.err
} }
return
} }
...@@ -887,8 +887,6 @@ func (p *printer) expr1(expr ast.Expr, prec1, depth int) { ...@@ -887,8 +887,6 @@ func (p *printer) expr1(expr ast.Expr, prec1, depth int) {
default: default:
panic("unreachable") panic("unreachable")
} }
return
} }
func (p *printer) possibleSelectorExpr(expr ast.Expr, prec1, depth int) bool { func (p *printer) possibleSelectorExpr(expr ast.Expr, prec1, depth int) bool {
...@@ -1268,8 +1266,6 @@ func (p *printer) stmt(stmt ast.Stmt, nextIsRBrace bool) { ...@@ -1268,8 +1266,6 @@ func (p *printer) stmt(stmt ast.Stmt, nextIsRBrace bool) {
default: default:
panic("unreachable") panic("unreachable")
} }
return
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
......
...@@ -230,7 +230,6 @@ func (name handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { ...@@ -230,7 +230,6 @@ func (name handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
runtime.GC() runtime.GC()
} }
p.WriteTo(w, debug) p.WriteTo(w, debug)
return
} }
// Index responds with the pprof-formatted profile named by the request. // Index responds with the pprof-formatted profile named by the request.
......
...@@ -240,7 +240,6 @@ func (root *mTreap) removeSpan(span *mspan) { ...@@ -240,7 +240,6 @@ func (root *mTreap) removeSpan(span *mspan) {
} }
} }
root.removeNode(t) root.removeNode(t)
return
} }
// scavengetreap visits each node in the treap and scavenges the // scavengetreap visits each node in the treap and scavenges the
......
...@@ -79,7 +79,6 @@ func defer1() { ...@@ -79,7 +79,6 @@ func defer1() {
panic("bad recover") panic("bad recover")
} }
}(1, 2, 3) }(1, 2, 3)
return
} }
func BenchmarkDefer10(b *testing.B) { func BenchmarkDefer10(b *testing.B) {
......
...@@ -202,7 +202,6 @@ func (t *Tree) recover(errp *error) { ...@@ -202,7 +202,6 @@ func (t *Tree) recover(errp *error) {
} }
*errp = e.(error) *errp = e.(error)
} }
return
} }
// startParse initializes the parser, using the lexer. // startParse initializes the parser, using the lexer.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment