golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.92k stars 17.52k forks source link

go/printer: spacing in /* comment not idempotent #1835

Closed rsc closed 9 years ago

rsc commented 13 years ago
mini=; cat fmt1.go
package main

func main() {
/*
prints test 5 times
*/
    for i := 0; i < 5; i++ {
        println("test")
    }
}

mini=; cat fmt1.go | gofmt
package main

func main() {
    /*
    prints test 5 times
    */
    for i := 0; i < 5; i++ {
        println("test")
    }
}
mini=; cat fmt1.go | gofmt | gofmt
package main

func main() {
    /*
        prints test 5 times
    */
    for i := 0; i < 5; i++ {
        println("test")
    }
}
mini=; 

It does stabilize at that point.

Pointed out on golang-nuts by Mustafa Zengin <mzengin88@gmail.com>
rsc commented 13 years ago

Comment 1:

Owner changed to @griesemer.

rsc commented 12 years ago

Comment 2:

Labels changed: added priority-later.

rogpeppe commented 12 years ago

Comment 4:

Issue #3584 has been merged into this issue.

rsc commented 12 years ago

Comment 5:

Labels changed: added go1.1.

griesemer commented 11 years ago

Comment 6:

This issue was closed by revision 241b23606c4c1d37071669c6e07c1918501835f.

Status changed to Fixed.