src/goDeclaration.ts: godef requires the right `GOROOT` env var

It uses runtime.GOROOT() to clean file names. If the version of
Go used to build the godef tool is different from the version of
Go we are currently using is different, it will not know the
right place for standard libraries without GOROOT env var.

Updates golang/vscode-go#294
Updates golang/vscode-go#146

Change-Id: I4b93023634d4f20b4e9802f756e168e41c1055f0
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/244758
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
diff --git a/src/goDeclaration.ts b/src/goDeclaration.ts
index 39542e0..0d13500 100644
--- a/src/goDeclaration.ts
+++ b/src/goDeclaration.ts
@@ -22,7 +22,8 @@
 	isPositionInString,
 	runGodoc
 } from './util';
-import {killProcessTree} from './utils/processUtils';
+import { getCurrentGoRoot } from './utils/goPath';
+import { killProcessTree } from './utils/processUtils';
 
 const missingToolMsg = 'Missing tool: ';
 
@@ -133,6 +134,7 @@
 	}
 	const offset = byteOffsetAt(input.document, input.position);
 	const env = toolExecutionEnvironment();
+	env['GOROOT'] = getCurrentGoRoot();
 	let p: cp.ChildProcess;
 	if (token) {
 		token.onCancellationRequested(() => killProcessTree(p));