Skip to content

Unnecessary newline in arguments when putting type parameters on a separate line #263

@ainar-g

Description

@ainar-g
gofumpt --version
v0.4.1-0.20230125043819-8b5f734ef391 (go1.20.1)

Before:

package main

func f[
	T any,
](v T) (ok bool) {
	_ = v

	return true
}

func main() {
	_ = f(42)
}

After:

package main

func f[
	T any,
](v T,
) (ok bool) {
	_ = v

	return true
}

func main() {
	_ = f(42)
}

Notice how there is now a comma and a newline after v T. Go 1.20.1's gofmt does not add it. In my opinion, gofumpt should not add this newline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions