Skip to content

cmd/gofmt: valid //line comments must remain at the beginning of the line #2990

Closed
@griesemer

Description

@griesemer
What steps will reproduce the problem?

gofmt $GOROOT/test/dwarf/linedirectives.go 


What is the expected output? What do you see instead?

Most line directives appear correct, but some are indented incorrectly.


This particular file also causes the gofmt long test to fail:

go test cmd/gofmt
--- FAIL: TestAll (18.53 seconds)
    long_test.go:86: /Users/gri/go/test/dwarf/linedirectives.go: not idempotent
FAIL
FAIL    cmd/gofmt   18.589s

(Albeit there are other known cases that cause gofmt to not be idempotent).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions