Skip to content

Linefeed removed after multi line comments in composite literals #170

@cckim

Description

@cckim

Composite literals have blank lines removed, but it seems to treat the trailing */ of a multi-line comment as a blank line.

If we add the following testcase to composite-literals-leading-lines

var _ = map[string]string{
        /*
        */

        "foo": "bar",
}

formatting produces:

var _ = map[string]string{
        /*
        */ "foo": "bar",
}

This seems like an unintended consequence of f2d9f32

Also, this creates a conflict with gofmt v0.1.7 which wants (removed blank space):

var _ = map[string]string{
        /*
        */"foo": "bar",
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions