src/goDebugFactory: don't use env['dlvPath']

The code that processes 'dlvPath' from the environment variables
was added in https://go-review.googlesource.com/c/vscode-go/+/240417/15/src/debugAdapter2/goDlvDebug.ts#555
That added one more way to configure the delve binary path
in addition to "go.alternateTools" setting. The benefit of
this extra config path is unclear, so let's delete it.

If we ever decide to allow users to configure the dlv tool
location from launch.json differently from what the
extension picks by default, we should use 'dlvToolPath'
attribute directly, rather than introducing another way
and asking users to set it through the 'env' attribute.

Change-Id: I52fd2a90029973c37787667c698019c2d456adce
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/304289
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Polina Sokolova <polina@google.com>
diff --git a/src/goDebugFactory.ts b/src/goDebugFactory.ts
index 9f73c08..3163d3c 100644
--- a/src/goDebugFactory.ts
+++ b/src/goDebugFactory.ts
@@ -13,6 +13,7 @@
 import path = require('path');
 import * as fs from 'fs';
 import * as net from 'net';
+import { getTool } from './goTools';
 
 export class GoDebugAdapterDescriptorFactory implements vscode.DebugAdapterDescriptorFactory {
 	public createDebugAdapterDescriptor(
@@ -272,12 +273,7 @@
 	const launchArgsEnv = launchArgs.env || {};
 	const env = Object.assign({}, process.env, launchArgsEnv);
 
-	// Let users override direct path to delve by setting it in the env
-	// map in launch.json; if unspecified, fall back to dlvToolPath.
-	let dlvPath = launchArgsEnv['dlvPath'];
-	if (!dlvPath) {
-		dlvPath = launchArgs.dlvToolPath;
-	}
+	const dlvPath = launchArgs.dlvToolPath ?? getTool('dlv');
 
 	if (!fs.existsSync(dlvPath)) {
 		const envPath = process.env['PATH'] || (process.platform === 'win32' ? process.env['Path'] : null);