1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:14:43 -07:00
go/imports
Filippo Valsorda 95963e031d imports: support symlinks in GOPATH
The go tool will import a package with a import path that traverses
symlinks with no problems, but goimports would remove that import
because it would fail to recognize the package as existent.

Fixes golang/go#14845

Note: if the file you are currently processing also has a name inside
the symlink, you might have to use the "long" path for vendoring to
work, as it wouldn't be recognized as "deeper" than the vendor folder
otherwise. For example in this tree:

.
├── myfile.go
└── x
    ├── vendor
    │   └── mypkg
    │       └── foo.go
    └── y -> ..

If myfile.go imports mypkg, you will have to process it as
./x/y/myfile.go, not ./myfile.go.

Change-Id: Ic8f41baed3f28d4e9b813160d91aef09ece1fc9f
Reviewed-on: https://go-review.googlesource.com/23803
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-09 03:45:06 +00:00
..
fix_test.go imports: support symlinks in GOPATH 2016-06-09 03:45:06 +00:00
fix.go imports: support symlinks in GOPATH 2016-06-09 03:45:06 +00:00
imports.go imports: add go:generate directive for generating zstdlib.go 2016-04-29 02:56:15 +00:00
mkindex.go go.tools/imports: move goimports from github to go.tools. 2013-12-17 21:21:03 -05:00
mkstdlib.go imports: add go:generate directive for generating zstdlib.go 2016-04-29 02:56:15 +00:00
sortimports.go imports: Remove ancient Go 1.1 compatibility indirections. 2015-12-14 00:47:31 +00:00
zstdlib.go imports: update static stdlib index to go1.6 2016-04-28 14:59:03 +00:00