Filed download and install Go modules dlv & gopls in VSCode - go

When i run my Go code in VSCode i needed install some modules. All modules normal downloaded and installing but 2 moduled (dlv & gopls) filed.
Tools environment: GOPATH=/home/user/project
Installing 2 tools at /home/user/project/bin in module mode.
dlv
gopls
Installing github.com/go-delve/delve/cmd/dlv#latest FAILED
{
"killed": false,
"code": 1,
"signal": null,
"cmd": "/usr/local/go/bin/go install -v github.com/go-delve/delve/cmd/dlv#latest",
"stdout": "",
"stderr": "go: downloading golang.org/x/sys v0.0.0-20220908164124-27713097b956\n../pkg/mod/github.com/sirupsen/logrus#v1.6.0/terminal_check_unix.go:6:8: golang.org/x/sys#v0.0.0-20220908164124-27713097b956: read \"https:/proxy.golang.org/#v/v0.0.0-20220908164124-27713097b956.zip\": read tcp 192.168.1.125:37454->209.85.233.141:443: read: connection reset by peer\n"
}
Installing golang.org/x/tools/gopls#latest FAILED
{
"killed": false,
"code": 1,
"signal": null,
"cmd": "/usr/local/go/bin/go install -v golang.org/x/tools/gopls#latest",
"stdout": "",
"stderr": "go: downloading golang.org/x/sys v0.2.0\n../pkg/mod/golang.org/x/tools#v0.3.1-0.20221213193459-ca17b2c27ca8/go/packages/external.go:15:2: golang.org/x/sys#v0.2.0: read \"https:/proxy.golang.org/#v/v0.2.0.zip\": read tcp 192.168.1.125:53838->142.250.185.209:443: read: connection reset by peer\n"
}
2 tools failed to install.
dlv: failed to install dlv(github.com/go-delve/delve/cmd/dlv#latest): Error: Command failed: /usr/local/go/bin/go install -v github.com/go-delve/delve/cmd/dlv#latest
go: downloading golang.org/x/sys v0.0.0-20220908164124-27713097b956
../pkg/mod/github.com/sirupsen/logrus#v1.6.0/terminal_check_unix.go:6:8: golang.org/x/sys#v0.0.0-20220908164124-27713097b956: read "https:/proxy.golang.org/#v/v0.0.0-20220908164124-27713097b956.zip": read tcp 192.168.1.125:37454->209.85.233.141:443: read: connection reset by peer
gopls: failed to install gopls(golang.org/x/tools/gopls#latest): Error: Command failed: /usr/local/go/bin/go install -v golang.org/x/tools/gopls#latest
go: downloading golang.org/x/sys v0.2.0
../pkg/mod/golang.org/x/tools#v0.3.1-0.20221213193459-ca17b2c27ca8/go/packages/external.go:15:2: golang.org/x/sys#v0.2.0: read "https:/proxy.golang.org/#v/v0.2.0.zip": read tcp 192.168.1.125:53838->142.250.185.209:443: read: connection reset by peer
In the terminal the code builds fine. I think the problem is in VSCode, but googling didn't turn up anything.

Related

trying to install fmt on archcraft stop because breaks dependency 'libfmt.so=8-64'

i'm trying to install a Archcraft theme, but when i run the command sudo pacman -U archcraft-wayfire-1.0-2-any.pkg.tar.zst it gave me this error:
 sudo pacman -U archcraft-wayfire-1.0-2-any.pkg.tar.zst
[sudo] password for rick:
loading packages...
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing fmt (9.1.0-1) breaks dependency 'libfmt.so=8-64' required by mpd
How can i fix?
Try installing fmt package by the following command:
sudo pacman -S fmt

/usr/bin/env: ruby2.1: Permission denied

fatal: [localhost]: FAILED! => {
"changed": true,
"cmd": "cd /home/username && bundle exec rake db:migrate RAILS_ENV=production",
"delta": "0:00:00.376426",
"end": "2022-08-03 12:33:57.663786",
"failed": true,
"rc": 126,
"start": "2022-08-03 12:33:57.287360",
"stderr": "Your RubyGems version (2.7.10) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3`\n/usr/bin/env: ruby2.1: Permission denied",
"stderr_lines": [
"Your RubyGems version (2.7.10) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3`",
"/usr/bin/env: ruby2.1: Permission denied"
],
"stdout": "",
"stdout_lines": []
}
What am I missing here?
[Later edit]
After going back and forth with this, installing I was able to fix it by running:
ln -s /usr/bin/ruby2.3 /usr/bin/ruby2.1
I fixed it by running:
ln -s /usr/bin/ruby2.3 /usr/bin/ruby2.1

VSCODE ON Monterey not working with Golang

I get the following error on vscode on Monterey with golang
Tools environment: GOPATH=/Users/randolphhill/devgo/workspace, GOBIN=/Users/randolphhill/devgo/workspace/bin
Installing 1 tool at the configured GOBIN: /Users/randolphhill/devgo/workspace/bin in module mode.
dlv
Installing github.com/go-delve/delve/cmd/dlv#latest FAILED
{
"killed": false,
"code": 2,
"signal": null,
"cmd": "/usr/local/opt/go/libexec/bin/go install -v github.com/go-delve/delve/cmd/dlv#latest",
"stdout": "",
"stderr": "go: cannot find GOROOT directory: /usr/local/opt/libexec\n"
}
1 tools failed to install.
dlv: failed to install dlv(github.com/go-delve/delve/cmd/dlv#latest): Error: Command failed: /usr/local/opt/go/libexec/bin/go install -v github.com/go-delve/delve/cmd/dlv#latest
go: cannot find GOROOT directory: /usr/local/opt/libexec
That seems like an odd GOROOT path. Have you tried uninstalling and reinstalling Go?
I have go installed and it is located at /usr/local/go/bin/go not /usr/local/opt/go/libexec/bin/go.
From the Go website: https://go.dev/doc/manage-install; The default install location is usually /usr/local/go.

How to solve vs code - gopls command is not available

The "gopls" command is not available. Run "go get -v golang.org/x/tools/gopls" to install.
I'm running on go 1.14. Not sure what will happen, if I follow the instruction.
Installing 1 tool at the configured GOBIN: /usr/local/go/bin in module mode.
gopls
Installing golang.org/x/tools/gopls FAILED
{
"killed": false,
"code": 1,
"signal": null,
"cmd": "/usr/local/go/bin/go get -v golang.org/x/tools/gopls",
"stdout": "",
"stderr": "go: downloading golang.org/x/tools/gopls v0.6.9\ngo: golang.org/x/tools/gopls upgrade => v0.6.9\ngo: downloading golang.org/x/tools v0.1.1-0.20210319172145-bda8f5cee399
...
1 tools failed to install.
gopls: failed to install gopls(golang.org/x/tools/gopls): Error: Command failed: /usr/local/go/bin/go get -v golang.org/x/tools/gopls
go: downloading golang.org/x/tools/gopls v0.6.9
go: golang.org/x/tools/gopls upgrade => v0.6.9
go: downloading golang.org/x/tools v0.1.1-0.20210319172145-bda8f5cee399
go: downloading golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c
go: downloading honnef.co/go/tools v0.1.1
go: downloading golang.org/x/mod v0.4.1
golang.org/x/mod/semver
...
go get golang.org/x/tools/gopls: copying /var/folders/gq/bwl3jmx562x5twchgxvb6mlh0000gn/T/go-build703164122/b001/exe/a.out: open /usr/local/go/bin/gopls: permission denied
no output
I had the same problem and solved it with:
go install -v golang.org/x/tools/gopls#latest
if you get the error:
x\tools#v0.1.13-0.20220811140653-b901dff69f70\internal\lsp\source\hover.go:23:2: module golang.org/x/text#latest found (v0.3.7), but does not contain package golang.org/x/text/unicode/runenames
try using:
go clean -modcache
go install -v golang.org/x/tools/gopls#latest
The extension depends on other tools to provide necessary features. gopls is one of the core tools necessary to provide language features like code completion, navigation, search, etc for go language. See the list of tools the extension depends on: https://github.com/golang/vscode-go/blob/master/docs/tools.md
"Install" will install the 'gopls'.
"Install All" will install all the missing tools.
If you are using go1.14, either click the button (or run "Go: Install/Update Tools" command from the command palette) or, install tools in module mode with the following command (not just go get because with go1.14, the go command will try to install the tool in GOPATH mode which isn't what you want.)
cd /tmp/
GO111MODULE=on go get golang.org/x/tools/gopls
Here I solved using the command brew install gopls

CERTIFICATE_VERIFY_FAILED while installing cairocffi with pip

When I run:
pip install cairocffi==0.9.0
I get:
...
Download error on https://pypi.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852) -- Some packages may not be found!
...
The error occurs due to some SSL certificates missing. To solve this I ran:
pip install certifi==2017.4.17

Resources