title: How to Setup "Go" environment on Windows
body: <p>I'm trying to setup Go on my Windows machine,</p>
  
  <p>I followed the instruction on this page <a href="https://golang.org/doc/code.html#Workspaces" rel="nofollow noreferrer">https://golang.org/doc/code.html#Workspaces</a> to launch hello.go and face some difficulties.</p>
  
  <p>So, I downloaded and installed MSI file</p>
  
  <p>Here is my Go version:
  go version go1.12.4 windows/amd64</p>
  
  <p>my go env:</p>
  
  <pre><code>set GOARCH=amd64
  set GOBIN=F:\GoWorckspace\bin
  set GOCACHE=C:\Users\Avetis\AppData\Local\go-build
  set GOEXE=.exe
  set GOFLAGS=
  set GOHOSTARCH=amd64
  set GOHOSTOS=windows
  set GOOS=windows
  set GOPATH=F:\GoWorckspace
  set GOPROXY=
  set GORACE=
  set GOROOT=E:\Go
  set GOTMPDIR=
  set GOTOOLDIR=E:\Go\pkg\tool\windows_amd64
  set GCCGO=gccgo
  set CC=gcc
  set CXX=g++
  set CGO_ENABLED=1
  set GOMOD=
  set CGO_CFLAGS=-g -O2
  set CGO_CPPFLAGS=
  set CGO_CXXFLAGS=-g -O2
  set CGO_FFLAGS=-g -O2
  set CGO_LDFLAGS=-g -O2
  set PKG_CONFIG=pkg-config
  set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Avetis\AppData\Local\Temp\go-build714242958=/tmp/go-build -gno-record-gcc-switches
  </code></pre>
  
  <p>GOPATH dir structure is:
  -bin/
  -pkg/
  -src/
       -hello/
              hello.go</p>
  
  <p>hello.go content:</p>
  
  <pre><code>package main
  
    import (
        "fmt"
    )
  
    func main() {
        fmt.Println("Hello World!")
    }
  </code></pre>
  
  <p>When I try <code>go install</code> I get this arror:</p>
  
  <pre><code> F:\GoWorckspace\src\hello&gt; go install hello.go
  open C:\Users\Avetis\AppData\Local\Temp\go-build786217674\b001\exe\a.out.exe: The system cannot find the file specified.
  </code></pre>
  
  <p>I have tried different options, but all of them lead to the same error:</p>
  
  <pre><code>PS F:\GoWorckspace\src&gt; go install .\hello\hello.go
  open C:\Users\Avetis\AppData\Local\Temp\go-build220985190\b001\exe\a.out.exe: The system cannot find the file specified.
  PS F:\GoWorckspace\src&gt; go install .\hello
  open C:\Users\Avetis\AppData\Local\Temp\go-build247169354\b001\exe\a.out.exe: The system cannot find the file specified.
  PS F:\GoWorckspace\src&gt; go install hello
  open C:\Users\Avetis\AppData\Local\Temp\go-build365645162\b001\exe\a.out.exe: The system cannot find the file specified.
  PS F:\GoWorckspace\src&gt; go build .\hello\hello.go
  open C:\Users\Avetis\AppData\Local\Temp\go-build274908638\b001\exe\a.out.exe: The system cannot find the file specified.
  </code></pre>