Hi all,
I want to make a small appeal regarding how you name your Go dashboard
packages.
Some people name their packages like this:
(1)
github.com/myname/mypkg
others name them like this
(2) mypkg
To clarify, the global name of packages is what you write in your
Makefile, not in your
go files. The go files always just say "package mypkg".
Naming convention (2) is bad. It is bad because it pollutes the global
namespace and no
other open-source developer could use the same pkg name in a project
that uses your
pkg as well. This will soon become a common problem, because pkg names
are usually
short words like "http", "file", "conf", "crypto", etc.
Beyond this, it is in your best interest to use (1) because it carries
your copyright information
much further:
When someone downloads an open source project and sees
import "
github.com/yourname/yourpkg"
They know where to go get the package (and hence you will be more
popular).
On the other hand, if they see
import "yourpkg"
They may have no idea what this package is, if the open-source project
they
downloaded is poorly documented.
A step further, I think it should be part of "goinstall" to check that
this naming convention
is enforced.
There is a one small problem with convention (1), which is that it
makes it
hard to switch between open source repositories, say from "
github.com"
to "
googlecode.com".
But this is hardly as much of an issue, in my opinion. And if you want
this level
of freedom, you should have your own domain "
myopensource.org" and
goinstall
should (eventually) have a way of using non-standard open source
repositories (if
it doesn't already).
Comments?
--P