You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a refinement of #16580. The bug described there is about code that is temporarily invalid due to the types in the "a/vendor/b" package being different from those in the "b" package. This bug is about what's likely a less controversial problem—that the eg command writes import declarations that include "/vendor/".
I ran eg against a file with access to a "vendor" directory. The template rewrote a function call from one provided by a package in the GOPATH to one provided by a package under the "vendor" directory. The contents of the GOPATH are shown (far) below.
What did you expect to see?
I expected eg's rewrite to result in valid import declarations, containing only the section of the path after the "vendor" segment.
What did you see instead?
The import declarations written by eg include a "/vendor/" segment.
Here are the contents of the GOPATH where I've reproduced the issue:
package eg
import (
"dep0"
"dep1"
)
// Test of adding a dependency that is found via a "vendor" directory
func before() { dep0.D() }
func after() { dep1.E() }
The text was updated successfully, but these errors were encountered:
This is a refinement of #16580. The bug described there is about code that is temporarily invalid due to the types in the "a/vendor/b" package being different from those in the "b" package. This bug is about what's likely a less controversial problem—that the
eg
command writes import declarations that include "/vendor/".What version of Go are you using (
go version
)?go version go1.7.1 darwin/amd64
, with golang/tools@c2ef61fWhat operating system and processor architecture are you using (
go env
)?What did you do?
I ran
eg
against a file with access to a "vendor" directory. The template rewrote a function call from one provided by a package in the GOPATH to one provided by a package under the "vendor" directory. The contents of the GOPATH are shown (far) below.What did you expect to see?
I expected
eg
's rewrite to result in validimport
declarations, containing only the section of the path after the "vendor" segment.What did you see instead?
The import declarations written by
eg
include a "/vendor/" segment.Here are the contents of the GOPATH where I've reproduced the issue:
./src/dep0/dep0.go:
./src/prog/vendor/dep1/dep1.go:
./src/prog/main.go:
And the template:
The text was updated successfully, but these errors were encountered: