Naming conventions for go packages are well-documented, with golang.org's blog stating:
Good package names are short and clear. They are lower case, with no under_scores or mixedCaps. They are often simple nouns, such as [descriptions removed]: time, list, http
The same guide then presents two examples of bad names:
Here are two examples of names that might be good style in other languages but do not fit well in Go: computeServiceClient, priority_queue
What the guide doesn't say is what to do when you have a package with a very specific purpose that really doesn't fit well as a one-word noun.
We have a library called Rhino Horn used internally for finding credentials that are being leaked accidentally. For reasons owing to how resource intensive it is to run Rhino Horn, I've been instructed to write a supervisor in golang for Rhino Horn that monitors its performance and enables quick shutoff when needed. Rhino Horn wasn't written in go, and is an entirely separate project.
What would the golang naming conventions have me name the Rhino Horn Supervisor?
I think there are many many many options. A few of which are:
main.go
, hornoutput.go
, or w/esupervisors
package and rhino horn being a single file with its implementation supervisors/rhinohorn
packagerhinohorn
package with a supervisor.go
file :P If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With