From 96f9b79bf95dd2490fb91c54c0377f22dee02e10 Mon Sep 17 00:00:00 2001 From: Shaunn Barron Date: Thu, 26 Oct 2017 15:40:11 -0400 Subject: [PATCH] Preventing Go users from having their GOPATH changed when upgrading. (#1787) * Preventing Go users from having their GOPATH changed when upgrading. * Updated to suggested manifest in review. Adds / removes default gopath/bin to the path without setting the gopath. Please move everything from `$persist_dir\go` to `$env:USERPROFILE\go` --- go.json | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/go.json b/go.json index 9d1bb4dd68..48be637ae3 100644 --- a/go.json +++ b/go.json @@ -5,13 +5,15 @@ "persist": "go", "extract_dir": "go", "env_set": { - "GOROOT": "$dir", - "GOPATH": "$persist_dir\\go" + "GOROOT": "$dir" + }, + "env_add_path": "bin", + "installer": { + "script": "add_first_in_path \"$env:USERPROFILE\\go\\bin\" $global" + }, + "uninstaller": { + "script": "remove_from_path \"$env:USERPROFILE\\go\\bin\" $global" }, - "env_add_path": [ - "bin", - "go\\bin" - ], "architecture": { "64bit": { "url": "https://storage.googleapis.com/golang/go1.9.2.windows-amd64.zip", @@ -38,7 +40,7 @@ }, "notes": " Your GOROOT has been set to: $dir - Your GOPATH has been set to: $persist_dir\\go - You can run 'go env GOPATH' or 'go env GOROOT' to view these at any time. + You can run 'go env GOROOT' to view this at any time. + \"$env:USERPROFILE\\go\\bin)\" has been added to your PATH. " }