[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: golang naming scheme



On 31/03/16 19:18, Russ Allbery wrote:

>>> If I understand correctly, the URL of a Go package is ABI.

> That's one of the reasons why so many people use github, since that URL is
> less likely to change.
> 
> One interesting detail of this approach is that it means that a takeover
> of the package by a different maintainer results in a different package
> name inherently.  I'm not sure whether it's a feature or a bug, but it's
> certainly interesting.

Actually, go uses the URL as both the import name and the location from
where to download sources when using "go get". But they are not
necessarily tied together.

Github could easily rename to goolab, and packages will not break,
because we don't use "go get", at least until upstreams start changing
the import names in the reverse dependencies.

And that is not something you can avoid by using any kind of clever
package naming.

Actually, the package name can be ignored completely (except for the
handiness of being automatically derived from the import name).

Moreover, it is fairly trivial to have a single binary package provide
different import names, by symlinking the directories where the sources
are stored. We have done this a few times already.

So, to conclude:

- yes, the package names are ugly, we know.
- they are still the best reasonable schema we could find, nobody was lazy
- there is no impending doom waiting to happen, at worst some annoyance.


-- 
Martín Ferrari (Tincho)


Reply to: