Skip to content

Commit

Permalink
update:match gop path when get relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
luoliwoshang committed Mar 22, 2024
1 parent 9dee575 commit 541c183
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/pathUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ export function getToolFromToolPath(toolPath: string): string | undefined {
export function expandFilePathInOutput(output: string, cwd: string): string {
const lines = output.split('\n');
for (let i = 0; i < lines.length; i++) {
const matches = lines[i].match(/\s*(\S+\.go):(\d+):/);
const matches = lines[i].match(/\s*(\S+\.(go|gop)):(\d+):/);
if (matches && matches[1] && !path.isAbsolute(matches[1])) {
lines[i] = lines[i].replace(matches[1], path.join(cwd, matches[1]));
}
}
return lines.join('\n');
}
}

0 comments on commit 541c183

Please sign in to comment.