4 ms·
In Go isn't `email.NewEmail()` more idiomatic? To be fair, you could write: e = &email.Email{ [fields and values] } The only thing NewEmail does is give you
by dkuntz2 13y ago
In Go isn't `email.NewEmail()` more idiomatic?
To be fair, you could write:
e = &email.Email{ [fields and values] }
The only thing NewEmail does is give you a pointer to an Email.
- ihsw 13y agoNot necessarily: https://www.google.com/search?q=golang+%22func+New(%22+site%3Agolang.org%2Fpkg https://www.google.com/search?q=golang+%22func+New(%22+site%...
- noselasd 13y agoThere's a lot of NewXXX too. The convention is if a package exports only one single type, call it New(...), otherwise call it NewXXX(...)