3 ms·
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 differe
by dub 8y ago
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
- johnisgood 8y agoRight 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.