go-lang-plugin-org/go-lang-idea-plugin — pull request #809 by wallyworld (2014-10-14 05:04:59+00:00)
Title: Add support for importing from paths with dots

When Go sees an import path like this:
"github.com/foo/bar.v1"

the bit after the "." is ignored and the real value of the import path used by the compiler is
"github.com/foo/bar"

even though the path on disk has the ".v1" bit in the directory.

The pull request adds support to import path processing and associated inspections and intentions to allow code with dotted import paths to be handled properly. The approach used is to treat the import statement as if a package reference were specified. The package reference is set to the part of the package name before the dot. Thus the above example is treated as if it were written like this:

bar "github.com/foo/bar.v1"

Other changes include allowing the auto completion pop up to work properly if more than one dotted package with the same root exists etc.

Unit tests pass and I added a couple of additional tests also.