gofumpt icon indicating copy to clipboard operation
gofumpt copied to clipboard

feature: Simple type-declaration statements

Open qianxi0410 opened this issue 2 years ago • 1 comments

As simplification of var declaration,Can you consider adding type declarations to the ranks of simplification?

exp:

type ExampleArgs struct {
	X int
}
type ExampleReply struct {
	Y int
}

after:

type (
	ExampleArgs struct {
		X int
	}
	ExampleReply struct {
		Y int
	}
)

qianxi0410 avatar Apr 22 '22 11:04 qianxi0410

Nice catch - we have always meant to do this reformatting, but we didn't because of a bug when it comes to multi-line type declarations. I have a patch in progress locally.

mvdan avatar Apr 22 '22 13:04 mvdan