Go

Go

Made by DeepSource

Immediate dereferencing of new expressions GO-C4002

Anti-pattern
Minor
Autofix

It is recommended to replace the immediate dereferencing of new expressions to the equivalent zero value of the type, i.e., new returns a pointer to a newly allocated zero value of the type passed as an argument to new, so dereferencing the same gives the zero value.

Bad practice

boolStore := *new(bool)

Recommended

boolStore := false // zero value of `bool` is `false`