Skip to content

cmd/gofmt: multiline function arguments are inconsistently indented #39586

@ijschwabacher

Description

@ijschwabacher

What version of Go are you using (go version)?

The playground reports that it's using go1.14.3.

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

The playground hides this information.

What did you do?

Format a function call with multiline arguments:

f((some
    multiline
  arg),
  (another
    multiline
  arg))

https://play.golang.org/p/UefV4IrB2C2

What did you expect to see?

Each multiline argument's continuation lines to be indented the same amount:

f((some
    multiline
  arg),
  (another
    multiline
  arg))

What did you see instead?

The continuation lines of the multiline argument that starts on the same line as the function call are not indented, but the remaining arguments are:

f((some
  multiline
arg),
  (another
    multiline
  arg))

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