x/tools/cmd/goimports: inconsistency with go fmt #37584
Labels
FrozenDueToAge
Tools
This label describes issues relating to any tools in the x/tools repository.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Used the tools
go fmt
andgoimports
on the following file (a minimal test case):Go fmt converts it to:
Goimports converts it to:
The two tools disagree. This results in them always trying to reformat each others' code.
Goimports starts to agree with gofmt if
Shorty
andShort
are in the opposite order, so that the field length progresses upward; or ifVeryMuchLongerFieldName
is reduced toMuchLongerFieldName
.The text was updated successfully, but these errors were encountered: