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

Commit

Permalink
Fix casing issue in Windows when finding GOPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Oct 2, 2017
1 parent f341ae0 commit e231f52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function goTest(testconfig: TestConfig): Thenable<boolean> {
return Promise.resolve();
}

// append the package name to args if applicable
// Append the package name to args to enable running tests in symlinked directories
let currentGoWorkspace = getCurrentGoWorkspaceFromGOPATH(getCurrentGoPath(), testconfig.dir);
if (currentGoWorkspace && !testconfig.includeSubDirectories) {
args.push(testconfig.dir.substr(currentGoWorkspace.length + 1));
Expand Down
6 changes: 5 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,11 @@ export function getCurrentGoPath(workspaceUri?: vscode.Uri): string {
workspaceUri = vscode.workspace.getWorkspaceFolder(vscode.window.activeTextEditor.document.uri).uri;
}
const config = vscode.workspace.getConfiguration('go', workspaceUri);
const currentRoot = workspaceUri ? workspaceUri.fsPath : vscode.workspace.rootPath;
let currentRoot = workspaceUri ? workspaceUri.fsPath : vscode.workspace.rootPath;
// Workaround for issue in https://github.com/Microsoft/vscode/issues/9448#issuecomment-244804026
if (process.platform === 'win32') {
currentRoot = currentRoot.substr(0, 1).toUpperCase() + currentRoot.substr(1);
}
const configGopath = config['gopath'] ? resolvePath(config['gopath'], currentRoot) : '';
const inferredGopath = config['inferGopath'] === true ? getInferredGopath(currentRoot) : '';

Expand Down

0 comments on commit e231f52

Please sign in to comment.