zlacker

[parent] [thread] 1 comments
1. abigai+(OP)[view] [source] 2024-01-24 09:06:33
i do the same because i find the var keyword ugly
replies(1): >>devjam+p7
2. devjam+p7[view] [source] 2024-01-24 10:19:39
>>abigai+(OP)
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.

[go to top]