Skip to content

Commit

Permalink
Support vendor directory as $GOPATH/src/vendor
Browse files Browse the repository at this point in the history
Updates golang#148
  • Loading branch information
Francesc Campoy committed Mar 10, 2017
1 parent 3df8773 commit 05bcf26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ func (c *Ctx) LoadProject(path string) (*Project, error) {
//
// The second returned string indicates which GOPATH value was used.
func (c *Ctx) SplitAbsoluteProjectRoot(path string) (string, error) {
// allow vendor directry to be directly under GOPATH/src
if filepath.Join(c.GOPATH, "src") == path {
return ".", nil
}

srcprefix := filepath.Join(c.GOPATH, "src") + string(filepath.Separator)
if filepath.HasPrefix(path, srcprefix) {
// filepath.ToSlash because we're dealing with an import path now,
Expand Down

0 comments on commit 05bcf26

Please sign in to comment.