In Go, public names begin with an uppercase letter, and private names begin with a lowercase letter.
I am writing a program that is not a library and is a single package. Are there any Go Idioms that determine if my identifiers should be public or private? I do not plan to use this package as a library or as something that should be imported from another Go program.
I can’t think of any reason why I need a mixture. He "feels" as if everyone is private - this is the right choice.
I don’t think I have any specific answer, but Nate was the closest, telling me that I think of “export and non-export” instead of “public and private”.
This makes me think that not exporting anything is best. In the worst case, if I end up importing code from my application into another package, I will have to rethink what needs to be exported and what should not be. Which is good, IMO.
source
share