Skip to content

cmd/gofmt: Inconsistent space before open curly brace #12043

@dsnet

Description

@dsnet

Using go1.5beta3.

This is obviously subjective, so feel free to close.

When struct definition is placed on a single line, it removes the space between the struct and {.

type Foo struct {
    int
}

type Bar struct{ int }

When an anonymous struct is used and instantiated, it lacks a space before the { as well.

for _, x := range []struct {
    b bool
    n int
}{ // There is NO space between '}' and '{'
    {false, 0},
    {true, 2},
    {false, 16},
} { // There IS a space between '}' and '{'
    fmt.Println(x)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions