title: Does os.exec from go (golang) not execute commands in $PATH?
body: <p>I was trying to execute shell commands using the exec library for go (golang). However, I whenever I tried to execute it using binaries that I installed with <code>go install</code> it didn't work. </p>
  
  <p>I tried running my binaries just on the terminal and they work. I checked that my $PATH did have the bin file for my go path so thats good in the terminal. But then I tried to do that same check in os exec by doing:</p>
  
  <pre><code>echo := exec.Command("echo", "$PATH")
  b, err := echo.Output()
  if err != nil {
      log.Fatal(err)
  }
  fmt.Println(string(b))
  </code></pre>
  
  <p>But suprisingly, it works in a weird way, it echos the literal string <code>$PATH</code>!! Incredible! Is there something that I am doing wrong? I can't even see what $PATH os exec is actually running...nor can I run my binaries in go exec as commands as in:</p>
  
  <p><code>exec.Command("myCommand").Run()</code></p>
  
  <p>Anyone has any suggestions as to why this might be?</p>
  
  <p>The issue with this question is <strong>not printing</strong> <code>$PATH</code>. What isn't working is that I can't run commands installed under <code>$GOPATH/bin</code> even though its under <code>$PATH</code></p>