Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 233cb1f

Browse files
author
Francesc Campoy
committed
Support vendor directory as $GOPATH/src/vendor
Updates #148
1 parent 3df8773 commit 233cb1f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

context.go

+5
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ func (c *Ctx) LoadProject(path string) (*Project, error) {
124124
//
125125
// The second returned string indicates which GOPATH value was used.
126126
func (c *Ctx) SplitAbsoluteProjectRoot(path string) (string, error) {
127+
// allow vendor directory to be directly under GOPATH/src
128+
if filepath.Join(c.GOPATH, "src") == path {
129+
return ".", nil
130+
}
131+
127132
srcprefix := filepath.Join(c.GOPATH, "src") + string(filepath.Separator)
128133
if filepath.HasPrefix(path, srcprefix) {
129134
// filepath.ToSlash because we're dealing with an import path now,

0 commit comments

Comments
 (0)