title: Does VS code retain some non-environment variables created from other windows?
body: <p>I was working in one VS Code window which had the <code>mapping</code> package in <code>OtherProject</code>. Given that I didn't understand what was going on there, I decided to create another directory in another window and create some toy/test code to experiment with. The relative file structure is.</p>
  <pre><code>- GoPractice
    - osTest.go
    - assignments.go
  - OtherProject
    - src
      - main
        - mapping.go
  
  </code></pre>
  <p>To continue with probing and trying to understand in <code>OtherProject</code>, I tried to use <code>dlv debug</code>. I couldn't build because I kept getting an error so I decided to start small with files in my <code>GoPractice</code> directory and searched for tutorials and landed on <a href="https://www.digitalocean.com/community/tutorials/debugging-go-code-with-visual-studio-code" rel="nofollow noreferrer">Digital Ocean's</a>. I created a <code>launch.json</code> file but when I launched the debugger, I got this error that refers to <code>mapping</code> that isn't related to the directory I have.</p>
  <pre><code>found packages main (assignments.go) and osTest (osTest.go) in C:\Users\User\Documents\GoPractice
  strconv.go:6:2: cannot find package &quot;mapping&quot; in any of:
      C:\Program Files\Go\src\mapping (from $GOROOT)
      C:\Users\User\go\src\mapping (from $GOPATH) (exit status 1)
  </code></pre>
  <p>Running <code>go env</code> in the window of:</p>
  <ul>
  <li><code>OtherProject</code> I get:</li>
  </ul>
  <pre><code>set GOPATH=C:/Users/User/OtherProject
  ...
  set GOROOT=C:\Program Files\Go
  </code></pre>
  <p>I don't understand why the file paths for <code>GOPATH</code> and <code>GOROOT</code> alternate between UNIX and Windows paths from the same command, <code>go env</code>.</p>
  <ul>
  <li><code>GoPractice</code> I get:</li>
  </ul>
  <pre><code>set GOPATH=C:\Users\User\go
  ...
  set GOROOT=C:\Program Files\Go
  </code></pre>
  <p>So mapping isn't coming from <code>GOPATH</code> even though I modified it in the original window. And here lies my confusion, it seems that there is a link to the original window's bash session but I can't tell what it is as my initial hunch of the environment variable is wrong based on <code>go env</code> output.</p>
  <p>Here's my <code>launch.json</code>:</p>
  <pre><code>{
      // Use IntelliSense to learn about possible attributes.
      // Hover to view descriptions of existing attributes.
      // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
      &quot;version&quot;: &quot;0.2.0&quot;,
      &quot;configurations&quot;: [
          {
              &quot;name&quot;: &quot;DebugServer&quot;,
              &quot;type&quot;: &quot;go&quot;,
              &quot;request&quot;: &quot;launch&quot;,
              &quot;mode&quot;: &quot;debug&quot;,
              &quot;program&quot;: &quot;${workspaceRoot}&quot;,
              &quot;dlvFlags&quot;: [&quot;--check-go-version=false&quot;]
          }
      ]
  }
  </code></pre>
  <p>I am running on Go <code>1.19.1</code> and I needed to suppress the warning for <code>dlv</code></p>