Skip to content

go/printer: incorrect formatting of empty comments #53059

Closed
@findleyr

Description

@findleyr

At tip (but not 1.18.2), go/printer incorrectly removes the blank line between A and B here:

func A() {
}

//
func B() {
}

resulting in

func A() {
}
func B() {
}

https://go.dev/play/p/VTb8TuGHV2U?v=gotip

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone 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