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

In golang packages named "main" are special. They're not importable and they correspond to a single executable.

If you want to be able to reuse code in different packages in the future or have more than one compiled binary, you won't be able to put everything into a single "main" package



Right now I use many internal packages. It makes my code more organized. By many, I use 4-5 and the number probably is not going to change. I dunno if this is a good idea, but it seems like the best I have got that suits me.




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

Search: