Q: go 有没有重排函数的工具

349 天前
 c3de3f21

比如写的时候随便写了直接

type Person struct{}

func init(){}

func (p *Person)say(){}

var p *Person

func NewPerson()*Person{
...
...
return p
}

func (p *Person)aha(){}

当我保存或者手动 format 的时候触发 lint 把我的格式变为

var p *Person
type Person struct{}
func init(){}
func NewPerson()
func (p *Person) say()
func (p *Person) aha()
474 次点击
所在节点    问与答
2 条回复
c3de3f21
349 天前
符合调用层次依次向下的或者有规律有结构的 lint
lilei2023
349 天前
这个功能确实好,目前使用 goland 貌似没发现有这个功能

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/951483

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX