I prefer *new(T) over T{}, because not only the reason here, but also the former has a smaller inline cost.
On Monday, March 17, 2025 at 4:49:51 PM UTC+8 Jan Mercl wrote: > On Mon, Mar 17, 2025 at 9:45 AM tapi...@gmail.com <tapi...@gmail.com> > wrote: > > > You can use *new(Version) instead of Version{} to avoid parsing > ambiguity. > > FTR: This would never pass my review. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/ef1d65ec-3e3f-411e-8d01-c144d058c03bn%40googlegroups.com.