6 ms·
Sure, I understand that from the POV of making your code explicit. Personally I have always tended towards, for example: var x string when initializing e
by devjam 3y ago
Sure, I understand that from the POV of making your code explicit. Personally I have always tended towards, for example:
var x string
when initializing empty (zero-value) vars, versus:
x := "hello"
when initializing variables that should hold an initial value.
To me as a Go programmer at least, this is more obvious and intuitive as to the intent of the declaration.