cmd/gofmt: inconsistent behavior on removing unnecessary type names with -s arg #64966
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go version go1.21.5 linux/amd64
Output of
go env
in your module/workspace:What did you do?
main.go
:gofmt -s -d main.go
will only suggest removing&Data
fromItem
, but not fromItems
:But removing both are perfectly fine: https://go.dev/play/p/pEfXLBwuwL1
What did you see happen?
gofmt -s
is inconsistent as it fail to suggest the same thing when it's under two or more layers of slices.What did you expect to see?
gofmt -s
being consistent.The text was updated successfully, but these errors were encountered: