Skip to content

Fresh install on windows fails to build any executables #69462

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

Closed
DevDrew64 opened this issue Sep 14, 2024 · 2 comments
Closed

Fresh install on windows fails to build any executables #69462

DevDrew64 opened this issue Sep 14, 2024 · 2 comments

Comments

@DevDrew64
Copy link

Go version

go version go1.23.1 windows/amd64

Output of go env in your module/workspace:

set GO111MODULE=                                                                                                        set GOARCH=amd64                                                                                                        set GOBIN=                                                                                                              set GOCACHE=C:\Users\user\AppData\Local\go-build                                                                       set GOENV=C:\Users\user\AppData\Roaming\go\env                                                                         set GOEXE=.exe                                                                                                          set GOEXPERIMENT=                                                                                                       set GOFLAGS=                                                                                                            set GOHOSTARCH=amd64                                                                                                    set GOHOSTOS=windows                                                                                                    set GOINSECURE=                                                                                                         set GOMODCACHE=C:\user\duebi\go\pkg\mod                                                                                set GONOPROXY=                                                                                                          set GONOSUMDB=                                                                                                          set GOOS=windows                                                                                                        set GOPATH=C:\Users\user\go                                                                                            set GOPRIVATE=                                                                                                          set GOPROXY=https://proxy.golang.org,direct                                                                             set GOROOT=C:\Program Files\Go                                                                                          set GOSUMDB=sum.golang.org                                                                                              set GOTMPDIR=                                                                                                           set GOTOOLCHAIN=auto                                                                                                    set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64                                                                set GOVCS=                                                                                                              set GOVERSION=go1.23.1                                                                                                  set GODEBUG=                                                                                                            set GOTELEMETRY=local                                                                                                   set GOTELEMETRYDIR=C:\Users\user\AppData\Roaming\go\telemetry                                                          set GCCGO=gccgo                                                                                                         set GOAMD64=v1                                                                                                          set AR=ar                                                                                                               set CC=gcc                                                                                                              set CXX=g++                                                                                                             set CGO_ENABLED=0                                                                                                       set GOMOD=NUL                                                                                                           set GOWORK=                                                                                                             set CGO_CFLAGS=-O2 -g                                                                                                   set CGO_CPPFLAGS=                                                                                                       set CGO_CXXFLAGS=-O2 -g                                                                                                 set CGO_FFLAGS=-O2 -g                                                                                                   set CGO_LDFLAGS=-O2 -g                                                                                                  set PKG_CONFIG=pkg-config                                                                                               set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\user\AppData\Local\Temp\go-build3679960513=/tmp/go-build -gno-record-gcc-switches

What did you do?

I first created a folder called go_test, then in a command prompt navigated inside that folder and ran the go mod init command with the name go_test. I then wrote the following program to test out my fresh install of go:

package main
import "fmt"
func main() {
fmt.Println("Hello World!")
}

and saved it inside a file called test.go.
Then, I attempted to build and run the code by running the following command: go run test.go

What did you see happen?

After running this command I got the following errors
image

What did you expect to see?

I expected to get the output "Hello World!", signifying that the program was successfully compiled and ran. I then uninstalled GO 1.23.1 and installed 1.22.7 and repeated the same steps and the program functioned as expected and outputted "Hello World!". This leads me to believe it is an issue with the install and something is missing? I found a report of this same issue but on version 1.20.2: #59295 if that helps.

@seankhliao
Copy link
Member

sounds like your installation of go is corrupted.

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants