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

cmd/gofmt: inconsistent formatting around & operator usage in function calls #49548

Closed
cornelk opened this issue Nov 12, 2021 · 3 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@cornelk
Copy link

cornelk commented Nov 12, 2021

What version of Go are you using (go version)?

go version go1.16.10 linux/amd64

Does this issue reproduce with the latest release?

Can be reproduced on https://play.golang.org/p/N-nQ9dTnyyi

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

2 simple calls with an argument that uses the & operator:

package main

import "fmt"

func main() {
	value := 1
	fmt.Println(value & 0x07FF, value)
	fmt.Println(value & 0x07FF)
}

What did you expect to see?

A consistent whitespace style around the & operator:

package main

import "fmt"

func main() {
	value := 1
	fmt.Println(value & 0x07FF, value)
	fmt.Println(value & 0x07FF)
}

What did you see instead?

2 different formatting styles, depending on if there are more arguments for the function call:

package main

import "fmt"

func main() {
	value := 1
	fmt.Println(value&0x07FF, value)
	fmt.Println(value & 0x07FF)
}
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 12, 2021
@cagedmantis cagedmantis added this to the Backlog milestone Nov 12, 2021
@cagedmantis
Copy link
Contributor

/cc @griesemer @mvdan

@mvdan
Copy link
Member

mvdan commented Nov 12, 2021

Duplicate of #34426, I'm pretty sure.

@seankhliao
Copy link
Member

Duplicate of #34426

@seankhliao seankhliao marked this as a duplicate of #34426 Nov 12, 2021
@golang golang locked and limited conversation to collaborators Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants