-
Notifications
You must be signed in to change notification settings - Fork 18.9k
cmd/gofmt: indenting removed from multi-line bullet-lists inside numbered lists #56072
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
What version of Go are you using (go version)?
$ go version go version go1.19.2 darwin/arm64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env(probably not relevant)
What did you do?
Given the following file;
/*
Package main is an example.
1. Item 1.
2. Item 2.
- SubItem 1.
- SubItem 2.
- SubItem 3 spans two lines. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
- Subitem 3 spans three lines. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
Mauris nisi magna, faucibus quis velit vitae, euismod convallis magna.
*/
package mainRunning gofmt reformat the bullet-list, removing the indentation for bullets spanning multiple lines;
gofmt -d .
diff main.go.orig main.go
--- main.go.orig
+++ main.go
@@ -6,9 +6,9 @@
- SubItem 1.
- SubItem 2.
- SubItem 3 spans two lines. Lorem ipsum dolor sit amet, consectetur
- adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
+ adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
- Subitem 3 spans three lines. Lorem ipsum dolor sit amet, consectetur
- adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
- Mauris nisi magna, faucibus quis velit vitae, euismod convallis magna.
+ adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
+ Mauris nisi magna, faucibus quis velit vitae, euismod convallis magna.
*/
package mainI also tried adding whitespace after the bullet-list (following the example at https://go.dev/doc/comment#mistakes):
/*
Package main is an example.
1. Item 1.
2. Item 2.
- SubItem 1.
- SubItem 2.
- SubItem 3 spans two lines. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
- Subitem 3 spans three lines. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
Mauris nisi magna, faucibus quis velit vitae, euismod convallis magna.
*/
package mainBut this gave the same result;
gofmt -d .
diff main.go.orig main.go
--- main.go.orig
+++ main.go
@@ -8,10 +8,9 @@
- SubItem 1.
- SubItem 2.
- SubItem 3 spans two lines. Lorem ipsum dolor sit amet, consectetur
- adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
+ adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
- Subitem 3 spans three lines. Lorem ipsum dolor sit amet, consectetur
- adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
- Mauris nisi magna, faucibus quis velit vitae, euismod convallis magna.
+ adipiscing elit. Morbi porta eros nunc, in viverra ex porttitor vitae.
+ Mauris nisi magna, faucibus quis velit vitae, euismod convallis magna.
*/
package mainWhat did you expect to see?
The indentation preserved.
What did you see instead?
The indentation removed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.