New import paths for Go sub-respositories

Skip to first unread message

Andrew Gerrand

Nov 5, 2014, 4:50:07 PM11/5/14
to golang-nuts
Summary: The sub-repo import paths are changing from "*" to "*". Please update your code on or before November 9.

As a prelude to the Go 1.4 release, the Go sub-repositories (,, go.crypto, and so on) will be made available using custom import paths. See for background.

This list shows the current base import paths, and their new equivalents.

The "x" in the path serves to disambiguate these external packages from the standard library.

If your code imports packages from these repositories, please prepare changes to update the import paths, and commit those changes either before or shortly after the official repositories are renamed. (These new import paths work today, but the code in those repositories has not yet been updated to use them.)

The change will be made on Sunday, November 9, 2014.


Any import path in any Go source file beginning with “” should change to begin with “”.

On Linux, OS X, and other Unix systems, this command updates all Go source files in the current directory and all subdirectories, so running it in your GOPATH workspace root should suffice to update all your source code:

    sed -i .orig 's|"code\.google\.com/p/go\.|"|' \
        $(find . -name '*.go')

Potential issues

After the change, code that uses the old import paths will not break. Instead, two copies of a given repository may be created inside your workspace.

For example, the "" package depends on "". After the change, these two paths will become "" and "", and the import statement in package ssa will be updated accordingly.

If your code imports the ssa package using its old path, when the import paths are changed the dependency graph will look like this:

If you run "go get", it will check out two copies of the repository: one under the old path, and one under the new path. If your program also contains references to "", you will end up with both copies of the go/types package (with different import paths) in the same executable.

To fix this, update the import statements in your code to use the new paths and then delete the old "src/*" directories from your workspace.

Andrew Gerrand

Nov 10, 2014, 1:38:27 AM11/10/14
to golang-nuts
The change has been made; the new paths are in effect.

Please update your code as per the instructions below, if you haven't done so already.
Reply all
Reply to author
0 new messages