I was using Go normally in my computer and it was compiling really fast (< 1s), but unfortunately after the visual studio code Go plugin asked me to install a bunch of things my Go become super slow, a simple code like this:
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello")
}
Is taking more than 10 seconds to execute:
[Running] go run "c:\dev\workspace\go\test\src\main.go"
Hello
[Done] exited with code=0 in 45.596 seconds
[Running] go run "c:\dev\workspace\go\test\src\main.go"
Hello
[Done] exited with code=0 in 16.242 seconds
[Running] go run "c:\dev\workspace\go\test\src\main.go"
Hello
[Done] exited with code=0 in 14.759 seconds
[Running] go run "c:\dev\workspace\go\test\src\main.go"
Hello
[Done] exited with code=0 in 15.492 seconds
[Running] go run "c:\dev\workspace\go\test\src\main.go"
Hello
[Done] exited with code=0 in 16.047 seconds
What I already have tried:
- Uninstalled everything and installed again;
- Changed Go version to 1.4 (it improved the compile time, but nothing really big, like in this version it compiled in ~7 seconds, what still making it slow)
- Tried other IDE (Idea)
Now I'm using the latest Go version:
$ go version
go version go1.15.2 windows/amd64
My "go env":
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\ticunha\AppData\Local\go-build
set GOENV=C:\Users\ticunha\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\dev\workspace\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\dev\workspace\go
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=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\ticunha\AppData\Local\Temp\1\go-build323480842=/tmp/go-build -gno-record-gcc-switches
Has anyone been through this and could give me some light on this problem? Thank you!