question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

go 1.18 (currently in beta) breaks install

See original GitHub issue

My system golang is running a beta version of golang 1.18, and I’m seeing the following error when trying to open a golang file:

[coc.nvim] Error: Command failed: env GOBIN="/usr/local/google/home/juliankatz/.config/coc/extensions/coc-go-data/bin" go get golang.org/x/tools/gopls@latest
go: go.mod file not found in current directory or any parent directory.
        'go get' is no longer supported outside a module.
        To build and install a command, use 'go install' with a version,
        like 'go install example.com/cmd@latest'
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.

It looks like your code should cover this problem, but perhaps I’m hitting an edge case in the regular expression. My go version output is:

❯ go version
go version go1.18-pre10 ab/123456789 +12345678ab linux/amd64

I’ve changed some information to not include proprietary info.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
roberChencommented, Feb 3, 2022

just simply modify the go install command in tools.js file.

  30   │     (await goRun(`install ${source}@latest`)) && (await goBinExists(name));

note. I found that my local file is older than the repository version, though it’s v1.1

6reactions
luisdavimcommented, Mar 24, 2022

Another workaround is to install gopls with:

env GOBIN="${HOME}/.config/coc/extensions/coc-go-data/bin" go install golang.org/x/tools/gopls@latest 
Read more comments on GitHub >

github_iconTop Results From Across the Web

Go 1.18 Release Notes - The Go Programming Language
Introduction to Go 1.18. The latest Go release, version 1.18, is a significant release, including changes to the language, implementation of the toolchain, ......
Read more >
Announcing Go 1.18 Beta 2 - The Go Programming Language
We released Go 1.18 beta 1 two months ago, and it is now the most downloaded Go beta ever, with twice as many...
Read more >
Go 1.18 will break the go get in our Makefiles #5481 - GitHub
When we start supporting 1.18, we'll need those Makefile templates to change over to use go install instead of go get .
Read more >
Go 1.18 Beta 1 is available, with generics | Hacker News
A big caveat in comparing OCaml and Go would be multicore support, but it's coming in OCaml, without breaking existing programs and with...
Read more >
Daniel Martí on Twitter: "Here's a list of some changes to look ...
Here's a list of some changes to look forward to in #golang 1.18! The first beta ... Native Go fuzzing is now ready...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found