DeepSource
Dashboard Resources Pricing Discover Directory Log in

Run your first analysis.

Find thousands of code security and quality issues in your codebase, before they end up in production.

Start now
All analyzers Go
Go

Go

By DeepSource

Use Analyzer
Docs
Discuss
Defers in infinite loops will never execute SCC-SA5003
Bug risk

Defers are scoped to the surrounding function, not the surrounding block. In a function that never returns, i.e. one containing an infinite loop, defers will never execute.

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

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.

Useless assignment VET-V0002
Bug risk
Autofix

Useless assignments are usually a result of error. For example:

Using bytes.Equal to compare two net.IP SCC-SA1021
Bug risk
Autofix

A net.IP stores an IPv4 or IPv6 address as a slice of bytes. The length of the slice for an IPv4 address, however, can be either 4 or 16 bytes long, using different ways of representing IPv4 addresses.

Invalid template SCC-SA1001
Bug risk

Issue is raised when templates cannot be parsed by the Parse function of html/template or text/template. For example, {{.Name}} {{.LastName} can not be parsed and causes runtime errors.