From 235a25c30297bb58792654e396d7b7369286b2de Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 31 Oct 2017 23:25:09 +0100 Subject: [PATCH] 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 --- src/cmd/cgo/ast.go | 3 --- 1 file changed, 3 deletions(-) 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 -- 2.48.1