On Sat, Dec 02, 2017 at 07:33:05AM -0800, Jonathan Hall wrote:
> I maintain an open-source Go package with a few dozen followers.  
> (github.com/flimzy/kivik)
> 
> I'm planning to transfer/rename the package to a new organization (new 
> package name to be: github.com/go-kivik/kivik).
> 
> I understand that GitHub will maintain a redirect from the old location to 
> the new one, so in theory, old imports will continue working.

This can be very intrusive for users of your package. Problems are wont
to occur as soon as there is code importing the package under different
names (actually turning them into distinct packages). This also applies
to code living in the same repo such as the "sub-packages" you mention.

If those are imported by another package in the same repo (using the new
name) and directly by users of your library as well (using the old
name), you'll end up with distinct packages and thus incompatible types,
a distinct set of package-level variables and so on.

You might be able to prevent some of that pain with a different
approach, by keeping the existing package alive but turning it into a
forwarder to the new package. Use type aliases for re-exporting types.

This is approximately what was done for the x/net/context package when
context was imported into the standard library. It only started to work
well once type aliases were available in Go.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to