Assuming I'm in a situation where I'm moving a Go package from
github.com/bad/old/import/path/pkg to github.com/good/pkg.
After copying the pkg to new import path, it's possible to:
1. Remove the old import path completely.
2. Keep the old import path README only saying "This package has moved to
github.com/good/pkg."
There's another option I can think of now. Replace the old import path with:
package pkg // import "github.com/good/pkg"
(That'd be source of github.com/bad/old/import/path/pkg/pkg.go.)
I've never tried this, but my understanding is that someone trying to "go
get github.com/bad/old/import/path/pkg" should get an error message saying
they should go get from "github.com/good/pkg" instead, which is what I want
them to do.
Does that seem like an acceptable use of import path checking, or am I
being too smart or overlooking some problems with it?
My question is about using import path checking this way, independent of
the question of if I should move import paths in the first place. For
reference, I typically check godoc.org importers and ensure no one is using
old import path before removing old import path package. So if your open
source code depends on my package, you'd better make me aware via godoc
importers page. If you're using it in closed source, you can vendor it,
etc. Or just update to new import path.
Thanks.
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.