When configuring the go environment with vscode
Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest FAILED
"stderr": "cannot install, GOBIN must be an absolute path\n" // Prompt to set absolute path
Go components can be installed here, but go.exe installation in Bin cannot be found
We enter go env to view the environment configuration
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=D:\Program Files\Go\bin // Here is the path used to install the go component
set GOCACHE=C:\Users\44305\AppData\Local\go-build
set GOENV=C:\Users\44305\AppData\Roaming\go\env // --------------------------------这里是env文件存放的位置
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\44305\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\44305\go
set GOPRIVATE=
set GOPROXY=https://goproxy.io,direct
set GOROOT=D:\Program Files\Go // ---------------Here is the location of the go installation
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.17.1
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
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\44305\AppData\Local\Temp\go-build352704544=/tmp/go-build -gno-record-gcc-switches
Use the command line to find that the settings still do not work. Finally, modify the file directly
1) the first step is to find the env file
set goenv = C:\users\44305\appdata\roaming\go\env// ——————————————- here is the location where the env file is stored
2) The second step is to open it with a notebook
3) the third step is to set the path here to the bin file in the following directory
set goroot = D:\program files\go// ——————– here is the location where go is installed
Finally, close vscode and then open it to install successfully
Tools environment: GOPATH=C:\Users\44305\go, GOBIN=D:\Program Files\Go\bin
Installing 8 tools at the configured GOBIN: D:\Program Files\Go\bin in module mode.
go-outline
gotests
gomodifytags
impl
goplay
dlv
staticcheck
gopls
Installing github.com/ramya-rao-a/go-outline@latest (D:\Program Files\Go\bin\go-outline.exe) SUCCEEDED
Installing github.com/cweill/gotests/gotests@latest (D:\Program Files\Go\bin\gotests.exe) SUCCEEDED
Installing github.com/fatih/gomodifytags@latest (D:\Program Files\Go\bin\gomodifytags.exe) SUCCEEDED
Installing github.com/josharian/impl@latest (D:\Program Files\Go\bin\impl.exe) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay@latest (D:\Program Files\Go\bin\goplay.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv@latest (D:\Program Files\Go\bin\dlv.exe) SUCCEEDED
Installing honnef.co/go/tools/cmd/staticcheck@latest (D:\Program Files\Go\bin\staticcheck.exe) SUCCEEDED
Installing golang.org/x/tools/gopls@latest (D:\Program Files\Go\bin\gopls.exe) SUCCEEDED
All tools successfully installed. You are ready to Go. :)
Read More:
- VScode: How to Solve golong plug-in install Error
- [Solved] Consul Error: github.com/boltdb/bolt github.com/boltdb/bolt github.com/hashicorp/raft-boltdb
- [Solved] Win10: Failed to connect to github.com port 443 Timed out
- [Solved] Git Run Error: Could not resolve host: github.com
- [Solved] ambiguous import: found package github.com/spf13/cobra/cobra in multiple modules
- Git Push Error: failed to push some refs to ‘[email protected]:
- [Solved] LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
- [Go] Solve can’t load package: cannot find module providing package github.com/xxxxx
- Cocoapods Install ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension.
- [Solved] LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
- [Solved] Installation failed due to: ‘INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Package com.
- [Solved] Phone Debug Program Error: The application could not be installed: INSTALL_FAILED_TEST_ONLY
- The application could not be installed: INSTALL_FAILED_USER_RESTRICTED
- [Solved] The application could not be installed: INSTALL_FAILED_NO_MATCHING_ABIS
- Execute an error under pytest cmd make sure your test modules/packages have valid Python names.
- [Solved] UE4 Android Package Error: cmd.exe failed with args
- [Solved] Manifest merger failed: android:exported needs to be explicitly specified for element <activity#com
- [Solved] MindSpore Error: For primitive[TensorSummary], the v rank Must be greater than or equal to 0
- [Solved] error: failed to run custom build command for `librocksdb-sys v6.17.3`
- [Solved] Android Studio 4 Error: The application could not be installed: INSTALL_FAILED_OLDER_SDK