Go version support
Support for Go 1.18
Version 0.8.0 of gopls supports features added to Go 1.18, specifically:
- Support for multi-module workspaces using
go.work
files. - Diagnostics for Fuzz tests.
- Improved support for generics.
To use these features, gopls must be installed using Go 1.18. See go.dev/dl for the latest status of Go 1.18 -- as of writing Go 1.18 is not yet released, but Go 1.18 RC1 may be used.
Dropped support for Go 1.12
Version 0.8.0 of gopls no longer supports building at Go 1.12. See golang/go#50827 for more details.
New Features
go.work
integration
Gopls now supports multi-module workspaces using go.work
files. To use this feature, create a go.work
file that includes the modules you want to work on, and then open your editor to the directory containing go.work
. For more information, see the go.work
reference, or the gopls documentation for multi-module workspaces.
Diagnostics for Fuzz tests
When writing Fuzz tests, gopls provides diagnostics for invalid arguments to Fuzz
.
Improved support for generics
Honor the language version configured in go.mod
gopls now provides diagnostics for language features based on the go
directive in the applicable go.mod
file for a package.
For some errors related to incompatible language versions, gopls offers a quick-fix to update the go.mod
Go version. (note that if the go.mod
file is open, it may need to be saved in order for language version changes to take effect)
Improved completion with type parameters
Gopls autocompletion is improved in several contexts when using generic types.
New code action to add missing method stubs
Gopls now provides a code action to implement missing methods.
Improved performance and accuracy for workspace symbol requests
Workspace symbols uses a new fuzzy matcher that is up to 3x faster than previous, and has improved ranking. See golang/go#50016 for more details. Note that the first time workspace symbols are requested, there may be a delay as the symbol cache is populated.
Improved gofumpt integration
Gopls now sets the language version and module path when invoking gofumpt, allowing more accurate formatting based on context.
Fixes
A full list of all issues fixed can be found in the gopls/v0.8.0 milestone. To report a new problem, please file a new issue at https://golang.org/issues/new.
Thank you to our contributors!
@ansaba @dr2chase @fzipp @heschi @hyangah @marwan-at-work @matloob @msAlcantara @mvdan @pjweinb @suzmue