bilibili / overlord

Overlord是哔哩哔哩基于Go语言编写的memcache和redis&cluster的代理及集群管理功能,致力于提供自动化高可用的缓存服务解决方案。
https://www.bilibili.com
MIT License
2.22k stars 408 forks source link

[Bug Report] miss makezero in slice init #177

Open alingse opened 4 months ago

alingse commented 4 months ago

I was running github actions to run linter makezero for top github golang repos.

see issues https://github.com/alingse/go-linter-runner/issues/1

and the github actions output https://github.com/alingse/go-linter-runner/actions/runs/9243212242/job/25427060632

====================================================================================================
append to slice `ofid` with non-zero initialized length at https://github.com/bilibili/overlord/blob/master/platform/mesos/scheduler.go#L243:10
====================================================================================================

the ofid := make([]ms.OfferID, len(offers)) should be ofid := make([]ms.OfferID, 0, len(offers))