fozdenn 13 hours ago

doesn't this point to a bigger problem that there are two ways of doing the same thing?

  • nikolayasdf123 12 hours ago

    no. it is different thing. container-agnostic zero value vs struct init.

  • unsnap_biceps 10 hours ago

    multiple ways of doing something isn't inherently bad.

    For example, if you want to set a variable to the number of seconds in seven hours, you could just set the variable to 25200, or you could set it to 60 * 60 * 7. The expanded version might be clearer in the code context, but in the end they do exactly the same thing.

    • nikolayasdf123 2 hours ago

      hold on, why would you have 7 hours?

      dont you mean a week? 60 x 60 x 24 x 7 ?

      or at lest 8 hours?

      7 hours is just odd

    • pests 10 hours ago

      Your math equation turned the asterisks into italics.

mr90210 13 hours ago

Oh you are one of those. The nit picker. This is not at a PR review mate.

  • nikolayasdf123 13 hours ago

    "one of those", name calling, telling me what to say,

    cool it down a little. touch some grass. and hopefully you will see beauty in Go zero-values :P

dwb 13 hours ago

Why?

  • nikolayasdf123 13 hours ago

    zero value. container-agnostic initialization. say your type is not struct anymore, you would not have to change the way you intialize it. what you care here is zero value, and let the type figure out that it is zero and use methods appropriately. and it is just more clean this way

    here is google guideline: https://google.github.io/styleguide/go/best-practices#declar...

    • dwb 12 hours ago

      That is a much better argument than saying it is "more clean", which doesn't mean anything. I don't necessarily agree, because I don't think zero values are a good feature of the language, and even if they were this is a completely trivial case. But at least I don't have to work out what "cleanliness" is.