new
expressions GO-C4002It 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.
boolStore := *new(bool)
boolStore := false // zero value of `bool` is `false`