Skip to content

cmd/gofmt: not idempotent on line with multiple comments #24472

@ALTree

Description

@ALTree
$ gotip version
go version devel +5f0a9ba134 Tue Mar 20 22:46:00 2018 +0000 linux/amd64

Note as the second gofmt invocation changes the code again:

$ cat test.go
package p

func f() {
	foo(); /* one */ fooooo(); /* two */
}

$ cat test.go | gofmt
package p

func f() {
	foo() /* one */
	fooooo() /* two */
}

$ cat test.go | gofmt | gofmt
package p

func f() {
	foo()    /* one */
	fooooo() /* two */

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions