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
That is, rewrite var name = value into name := value. The same would happen for var n1, n2 = v1, v2, which would become n1, n2 := v1, v2.
Exceptions:
Globals, because name := value is only valid as a statement
var name Type = value and var name Type
The only edge case I see is var name = zerovalue, like var s = "". Rewriting that to s := "" is fine, but some people might prefer var s string. Then again, if people prefer that form, they can use it directly and the tool won't change it.
The text was updated successfully, but these errors were encountered:
That is, rewrite
var name = value
intoname := value
. The same would happen forvar n1, n2 = v1, v2
, which would becomen1, n2 := v1, v2
.Exceptions:
name := value
is only valid as a statementvar name Type = value
andvar name Type
The only edge case I see is
var name = zerovalue
, likevar s = ""
. Rewriting that tos := ""
is fine, but some people might prefervar s string
. Then again, if people prefer that form, they can use it directly and the tool won't change it.The text was updated successfully, but these errors were encountered: