小编Mah*_*ani的帖子

如何解决考虑预分配(prealloc)lint?

Consider preallocating [to] (prealloc)golangci-lint 我的代码中发现这个问题是:

var to []string
for _, t := range s.To {
    to = append(to, t.String())
}
Run Code Online (Sandbox Code Playgroud)

您是否有在 lint 中解决此问题的想法?

lint go slice

8
推荐指数
1
解决办法
3183
查看次数

标签 统计

go ×1

lint ×1

slice ×1