mirror of https://github.com/golang/go.git
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: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
78510bd17c
commit
ff7994ac10
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -39,5 +39,4 @@ func catchError(err *error) {
|
|||
}
|
||||
*err = ge.err
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -240,7 +240,6 @@ func (root *mTreap) removeSpan(span *mspan) {
|
|||
}
|
||||
}
|
||||
root.removeNode(t)
|
||||
return
|
||||
}
|
||||
|
||||
// scavengetreap visits each node in the treap and scavenges the
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ func defer1() {
|
|||
panic("bad recover")
|
||||
}
|
||||
}(1, 2, 3)
|
||||
return
|
||||
}
|
||||
|
||||
func BenchmarkDefer10(b *testing.B) {
|
||||
|
|
|
|||
|
|
@ -202,7 +202,6 @@ func (t *Tree) recover(errp *error) {
|
|||
}
|
||||
*errp = e.(error)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// startParse initializes the parser, using the lexer.
|
||||
|
|
|
|||
Loading…
Reference in New Issue