Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ainar-g opened this issue Feb 28, 2023 · 0 comments

Comments

@ainar-g
Copy link

ainar-g commented Feb 28, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant