Skip to content

Commit 171cc61

Browse files
firelizzard18hyangah
authored andcommitted
src/goToolPprof: execFile instead of exec
Fixes #1779 Change-Id: I6e5f6f91cac34c2d0195cb4f4fd564da840b7643 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/350739 Reviewed-by: Hyang-Ah Hana Kim <[email protected]> Trust: Hyang-Ah Hana Kim <[email protected]> Trust: Robert Findley <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]>
1 parent 0ae12d0 commit 171cc61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/goToolPprof.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright 2021 The Go Authors. All rights reserved.
33
* Licensed under the MIT License. See LICENSE in the project root for license information.
44
*--------------------------------------------------------*/
5-
import { exec } from 'child_process';
5+
import { execFile } from 'child_process';
66
import { window, CancellationToken, TextDocumentContentProvider, Uri } from 'vscode';
77
import { outputChannel } from './goStatus';
88
import { getBinPath } from './util';
@@ -15,7 +15,7 @@ export class ProfileDocumentContentProvider implements TextDocumentContentProvid
1515
private pprof(uri: Uri, token: CancellationToken) {
1616
const goBin = getBinPath('go');
1717
return new Promise<string | undefined>((resolve) => {
18-
const cp = exec(`${goBin} tool pprof -tree ${uri.fsPath}`, async (err, stdout, stderr) => {
18+
const cp = execFile(goBin, ['tool', 'pprof', '-tree', uri.fsPath], async (err, stdout, stderr) => {
1919
if (err || stderr) {
2020
const m = 'Failed to execute `go tool pprof`';
2121
if (err) outputChannel.appendLine(`${m}: ${err}`);

0 commit comments

Comments
 (0)