Can't launch go programs

Hello,
I tried to install Go on my computer, but something didn’t work and I can’t find what, as I don’t have any error.

I followed the Go installation instructions that I found on the website https://golang.org/doc/install.
My OS is Windows 10, so I used the msi installer. Everything worked well, until the “Test your installation” part.

I created the hello.go file, then launched the command “go install github.com/user/hello”, which seemed to work because the file hello.exe was created in my GOPATH/bin directory

But when I typep “%GOPATH%/bin/hello” in the command prompt, nothing happend. The console just king of froze. I got no error message, or anything. I restarted the computer, but the same thing happend. I reinstalled Go, but it is still the same.
Could someone help me please ?

go env give me this :
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\workgo
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GO15VENDOREXPERIMENT=1
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1

My first go to thing when mysterious things happen on Windows is “have you tried turning off your antivirus?”…

1 Like

Bonjour Anne-Marie,

complete shot in the dark, but, have you tried:

> %GOPATH%/bin/hello.exe

instead?
(ie: with the .exe at the end)

Can you show your code ? You may be sending the output incorrectly. To see something on your screen, it needs to be os.Stdout

Thank you people, the problem was my antivirus (Avast). I feel dumb not thinking of that myself. I still think that it should have sent me a notification to tell me something was blocked.

Anyway, thank you very much for your help :smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.