Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Support vendor pkgs from root of GOPATH/src #660

Merged
merged 1 commit into from
Nov 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/goImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ export function listPackages(excludeImportedPkgs: boolean = false): Thenable<str
return;
}

let magicVendorString = '/vendor/';
let magicVendorString = 'vendor/';
let vendorIndex = pkg.indexOf(magicVendorString);

// Check if current file and the vendor pkg belong to the same root project
// If yes, then vendor pkg can be replaced with its relative path to the "vendor" folder
// If not, then the vendor pkg should not be allowed to be imported.
if (vendorIndex > 0) {
if (vendorIndex > -1) {
let rootProjectForVendorPkg = path.join(currentWorkspace, pkg.substr(0, vendorIndex));
let relativePathForVendorPkg = pkg.substring(vendorIndex + magicVendorString.length);

Expand Down