Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.




There's a lot of NewXXX too. The convention is if a package exports only one single type, call it New(...), otherwise call it NewXXX(...)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: