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

prevent indentation confusion #299

Open
pavelnikolov opened this issue Feb 26, 2024 · 0 comments
Open

prevent indentation confusion #299

pavelnikolov opened this issue Feb 26, 2024 · 0 comments

Comments

@pavelnikolov
Copy link

Unlike in #2 I'd like to actually prevent breaking long lines in the middle of function definition and causing indentation confession. Right now gofmt accepts both:

func somethingTooLong(ctx context.Context, longArgument string, anotherOne func(time.Duration) bool) (int, error) {
	// foo
}

and

func somethingTooLong(
	ctx context.Context,
	longArgument string,
	anotherOne func(time.Duration) bool
) (int, error) {
	// foo
}

I personally never want to break long lines in Go, however many other people do. That is why I'd like at least to enforce no indentation confusion by splitting the declaration of a function in the middle of it's args, for example:

func somethingTooLong(ctx context.Context, longArgument string,
	anotherOne func(time.Duration) bool) (int, error) {
	// foo
}

This ^ is a big no-no, IMHO. How do I enforce no splitting of argument list in the middle?

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