From: Tobias Klauser Date: Tue, 31 Oct 2017 22:25:09 +0000 (+0100) Subject: cmd/cgo: remove unnecessary nil check X-Git-Tag: go1.10beta1~484 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=235a25c30297bb58792654e396d7b7369286b2de;p=gostls13.git cmd/cgo: remove unnecessary nil check commentText is only called if g != nil in ParseGo, so the check inside commentText is redundant and can be deleted. Change-Id: I130c18b738527c96bc59950b354a50b9e23f92e9 Reviewed-on: https://go-review.googlesource.com/74871 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/cgo/ast.go b/src/cmd/cgo/ast.go index 96cad8050c..f59f7afcb7 100644 --- a/src/cmd/cgo/ast.go +++ b/src/cmd/cgo/ast.go @@ -144,9 +144,6 @@ func (f *File) ParseGo(name string, src []byte) { // Like ast.CommentGroup's Text method but preserves // leading blank lines, so that line numbers line up. func commentText(g *ast.CommentGroup) string { - if g == nil { - return "" - } var pieces []string for _, com := range g.List { c := com.Text