title: Go programs hanging on Windows 10
body: <p>I've been having issues with all Go programs hanging on Windows, even a simple Hello world program. I've reinstalled Golang multiple times with nothing changing. I can't use Ctrl+X or Ctrl+D to close the program either. It'll still spawn the process which will show up on Process Monitor. But I can't kill it from there or from the command line.</p>
  
  <p>There was a similar issue to this posted on reddit <a href="https://www.reddit.com/r/golang/comments/2lvnqk/not_even_hello_world_works/" rel="nofollow">https://www.reddit.com/r/golang/comments/2lvnqk/not_even_hello_world_works/</a>. But that still has no resolution.</p>
  
  <p>The is the program I'm trying to get to run right now:</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func main() {
      fmt.Println("Hello, world!")
  }
  </code></pre>
  
  <p>Running it with <code>go run -x</code> gives this output:</p>
  
  <pre><code>WORK=C:\Users\User\AppData\Local\Temp\go-build882050150
  mkdir -p $WORK\command-line-arguments\_obj\
  mkdir -p $WORK\command-line-arguments\_obj\exe\
  cd E:\go\src\github.com\test\hello
  "C:\\Go\\pkg\\tool\\windows_amd64\\compile.exe" -o "C:\\Users\\User\\AppData\\Local\\Temp\\go-build882050150\\command-line-arguments.a" -trimpath "C:\\Users\\User\\AppData\\Local\\Temp\\go-build882050150" -p main -complete -buildid 0180ed6e175ea3e4bc497fc21fe0319a733a9c8e -D _/E_/go/src/github.com/test/hello -I "C:\\Users\\User\\AppData\\Local\\Temp\\go-build882050150" -pack "E:\\go\\src\\github.com\\test\\hello\\main.go"
  cd .
  "C:\\Go\\pkg\\tool\\windows_amd64\\link.exe" -o "C:\\Users\\User\\AppData\\Local\\Temp\\go-build882050150\\command-line-arguments\\_obj\\exe\\main.exe" -L "C:\\Users\\User\\AppData\\Local\\Temp\\go-build882050150" -w -extld=gcc -buildmode=exe -buildid=0180ed6e175ea3e4bc497fc21fe0319a733a9c8e "C:\\Users\\User\\AppData\\Local\\Temp\\go-build882050150\\command-line-arguments.a"
  $WORK\command-line-arguments\_obj\exe\main.exe
  </code></pre>
  
  <p>After that it just sits there and dose nothing. Doesn't matter what program I run it will always hang forever.</p>
  
  <p>No idea where to go from here. I don't really develop on Windows but I was trying to work with cross-compilation on Ubuntu and having run into this issue with the cross-compiled binary I thought I'd try compiling directly on Windows. But it appears my Windows just doesn't like Golang compiled binaries.</p>
  
  <p>Go version is 1.5.1 windows/amd64.</p>
  
  <p>Here's the output of <code>go env</code>:</p>
  
  <pre><code>set GOARCH=amd64
  set GOBIN=
  set GOEXE=.exe
  set GOHOSTARCH=amd64
  set GOHOSTOS=windows
  set GOOS=windows
  set GOPATH=E:\go
  set GORACE=
  set GOROOT=C:\Go
  set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
  set GO15VENDOREXPERIMENT=
  set CC=gcc
  set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
  set CXX=g++
  set CGO_ENABLED=1
  </code></pre>