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

remove newlines right after an assignment operator #76

Closed
mvdan opened this issue Jul 3, 2020 · 0 comments
Closed

remove newlines right after an assignment operator #76

mvdan opened this issue Jul 3, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mvdan
Copy link
Owner

mvdan commented Jul 3, 2020

The following isn't modified by gofmt nor gofumpt:

package main

func main() {
	foo :=
		"bar"
}

We should probably not allow such a newline. I would have guessed that it was valid Go, but that gofmt would not allow it.

I'm trying to think of a scenario where it would make sense, but I can't. There isn't any consistency with a closing token on a separate line here. The only possibly reasonable use case I can think of is:

foo :=
    `
        multi-line
        content
    `

Which someone could think is a tiny bit nicer than:

foo := `
        multi-line
        content
    `

Still, I don't think it's worth the weird syntax and extra newline/verbosity.

@mvdan mvdan added the enhancement New feature or request label Nov 23, 2020
@mvdan mvdan added the good first issue Good for newcomers label Sep 26, 2021
@mvdan mvdan closed this as completed in f3595ed Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant