Pages

Tuesday, 8 November 2022

Why is there a "new" function in Golang?

0 TL;DR

  • new is not widely used in GO nowadays
  • It basically does the same things as "&MyType{}" which is more common and flexible
  • new is a history; it may be deleted in Go version 2.

1 useful links about this Topic

  •  https://groups.google.com/g/golang-nuts/c/K3Ys8qpml2Y
  • https://softwareengineering.stackexchange.com/questions/210399/why-is-there-a-new-in-go

No comments:

Post a Comment