Go

Go

Made by DeepSource

The empty for loop (for {}) spins and can block the scheduler SCC-SA5002

Bug risk
Major

An empty loop is bad news in two cases: 1) The loop has no condition. In that case, it's just a loop that spins forever and as fast as it can, keeping a core busy. 2) The loop condition only consists of variable or field reads and operators on those. The only way those could change their value is with unsynchronised access, which constitutes a data race.