Go

Go

Made by DeepSource

for { select { ... } } with an empty default branch spins SCC-SA5004

Bug risk
Major
Autofix

If you put an empty default: case in the select, it makes it non-blocking, which means that when no communication can proceed it executes the default case and, being empty, finishes immediately. Then the for { } loop runs the select over and over.