You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your feature request related to a problem? Please describe.
The zero linter finds unnecessary assignment which zero value assigns to a variable:
package a
var_string=""// want "shoud not assign zero value"func_() {
n:=0// want "shoud not assign zero value"_=nvar_ []int=nil// want "shoud not assign zero value"var_ []int= []int{} // OKm:=int32(0) // OK_=mvar_*int=nil// want "shoud not assign zero value"var_struct{} =struct{}{} // want "shoud not assign zero value"var_, _int// OKvar_, _int=0, 1// want "shoud not assign zero value"var_, _int=1, 2// OKvar_, _int=1-1, 2-2// want "shoud not assign zero value" "shoud not assign zero value"var_bool=false// want "shoud not assign zero value"var_bool=true// OKtypeTstruct{ Nint }
var_T=T{} // want "shoud not assign zero value"
}
Your feature request related to a problem? Please describe.
The
zero
linter finds unnecessary assignment which zero value assigns to a variable:https://github.com/gostaticanalysis/zero
Describe the solution you'd like.
—
Describe alternatives you've considered.
—
Additional context.
No response
The text was updated successfully, but these errors were encountered: