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
Using a deprecated function, variable, constant or field GO-W1009
Anti-pattern

Sometimes a function, variable, constant, field, or whole package becomes redundant or unnecessary but must be kept for compatibility with existing programs. These should not be used except for compatibility with legacy systems.

true is implicit in switch statements CRT-A0015
Anti-pattern
Autofix

If no tag is given with switch, it assumes true.

Simplify if statement for single bool judgment GO-R1004
Anti-pattern
Autofix

if statement can be simplified where only a single bool judgment is happening. It is more idiomatic not to store the result of a function returning a bool and compare that in if statement's conditional. It is better to skip the initialization expression.

Use any instead of interface{} GO-R3001
Anti-pattern
Autofix

In Go 1.18+, empty interface (interface {}) is recommended to be replaced by any.

Use time.Sleep instead of single case select SCC-S1037
Anti-pattern
Autofix

Instead of using a single case in a select statement that receives results from time.After is preferable to simply use time.Sleep.