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

In Go, you can use an interface to implement private struct fields. Then you can make a "New" function to implement default values as needed. I made a post about this last month:

https://stackoverflow.com/a/63552596



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: