4 ms·
Agree with it or not, it’s recommended by the docs: > It's helpful if everyone using the package can use the same name to refer to its contents, which implies
by corytheboyd 2y ago
Agree with it or not, it’s recommended by the docs:
> It's helpful if everyone using the package can use the same name to refer to its contents, which implies that the package name should be good: short, concise, evocative. By convention, packages are given lower case, single-word names; there should be no need for underscores or mixedCaps.
https://go.dev/doc/effective_go#names https://go.dev/doc/effective_go#names
Maybe the convention of single-letter variable names was meant to play nicely with this too (again, agree with it or not).
Can’t say I really care about this issue that much, it’s occasionally a slight nuisance, but show me a programming language that doesn’t have the occasional slight nuisance.
An explicit scope resolution operator would be a better solution than forcing package name changes, as called out by another commenter. Maybe that was left out to keep it simple? If anyone knows of a Go blog post about the decision to omit this feature I’d be curious to see it!