Reputation: 12378
Is there a way to import external modules into one file and then import from that file?
For example:
// externals.go
import (
Bitbucket "bitbucket.org/user/project"
Github "github.com/user/project"
)
// main.go
import (
"externals/Bitbucket"
"externals/Github"
)
Is the above in some form possible?
Upvotes: 0
Views: 450
Reputation: 6670
No, this is not possible. It is a specific design goal of Go to make all dependencies explicit.
See http://talks.golang.org/2012/splash.article and section 7 in particular for more detail on this.
Upvotes: 1