Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run go program in windows 10 #40237

Closed
Rani1406 opened this issue Jul 16, 2020 · 3 comments
Closed

Not able to run go program in windows 10 #40237

Rani1406 opened this issue Jul 16, 2020 · 3 comments

Comments

@Rani1406
Copy link

@Rani1406 Rani1406 commented Jul 16, 2020

What version of Go are you using (go version)?

$ go version 
go version go1.14.5 windows/amd64

Does this issue reproduce with the latest release?

No

What operating system and processor architecture are you using (go env)?

Windows 10 Enterprise edition , Processor-->intel core i5 7300U CPU

go env Output
$ go env
C:\Users\x6rmahad>go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\x6rmahad\AppData\Local\go-build
set GOENV=C:\Users\x6rmahad\AppData\Roaming\go\env
set GOEXE=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=linux
set GOPATH=C:\Users\x6rmahad\Project
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
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=-fPIC -m64 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\x6rmahad\AppData\Local\Temp\go-build110527706=/tmp/go-build -gno-record-gcc-switches

What did you do?

run the command
$ go run main.go

What did you expect to see?

output of the application

What did you see instead?

exec: "C:\Users\x6rmahad\AppData\Local\Temp\go-build670588414\b001\exe\main": file does not exist

@davecheney
Copy link
Contributor

@davecheney davecheney commented Jul 16, 2020

Thank you for raising this issue. This issue commonly arises on windows platforms. https://golang.org/doc/faq#virus

@Rani1406
Copy link
Author

@Rani1406 Rani1406 commented Jul 16, 2020

In environment variables GOOS is linux Changed to windows issue resolved.

@Rani1406 Rani1406 closed this Jul 16, 2020
@davecheney
Copy link
Contributor

@davecheney davecheney commented Jul 16, 2020

Ahh, of course. My mistake, I should have spotted that the executable did not end in .exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.