Skip to content

gofmt does some strange linebreaks #1632

@mark-summerfield

Description

@mark-summerfield
Given this source code:

if writer, err = os.Open(outfile, s.O_WRONLY|os.O_CREATE|
        os.O_TRUNC, 0666); err != nil {
    log.Fatal(err)
}

gofmt -tabwidth=4 -tabindent=false

Produces:

if writer, err = os.Open(outfile,os.O_WRONLY|os.O_CREATE|
    os.O_TRUNC,
    0666); err != nil {
    log.Fatal(err)
}

Notice the newline inserted before the file permissions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions