1
0
mirror of https://github.com/golang/go synced 2024-11-18 20:04:52 -07:00

go/printer: remove unused comment parameter

Found by github.com/mvdan/unparam.

Change-Id: I5b0c7cfdc1ab4fe0d79ef4c5a31612bbcf2ff3ad
Reviewed-on: https://go-review.googlesource.com/37833
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Daniel Martí 2017-03-05 13:45:10 +01:00 committed by Robert Griesemer
parent 5f3281139d
commit 9600c32cc5

View File

@ -325,7 +325,7 @@ func (p *printer) writeString(pos token.Position, s string, isLit bool) {
// after all pending comments, prev is the previous comment in // after all pending comments, prev is the previous comment in
// a group of comments (or nil), and tok is the next token. // a group of comments (or nil), and tok is the next token.
// //
func (p *printer) writeCommentPrefix(pos, next token.Position, prev, comment *ast.Comment, tok token.Token) { func (p *printer) writeCommentPrefix(pos, next token.Position, prev *ast.Comment, tok token.Token) {
if len(p.output) == 0 { if len(p.output) == 0 {
// the comment is the first item to be printed - don't write any whitespace // the comment is the first item to be printed - don't write any whitespace
return return
@ -733,7 +733,7 @@ func (p *printer) intersperseComments(next token.Position, tok token.Token) (wro
var last *ast.Comment var last *ast.Comment
for p.commentBefore(next) { for p.commentBefore(next) {
for _, c := range p.comment.List { for _, c := range p.comment.List {
p.writeCommentPrefix(p.posFor(c.Pos()), next, last, c, tok) p.writeCommentPrefix(p.posFor(c.Pos()), next, last, tok)
p.writeComment(c) p.writeComment(c)
last = c last = c
} }