Gopls release v0.24.0 (expected Sep 2026)
In this release:
Key features are described below.
Gopls now supports v3.18 of the Language Server Protocol.
Configuration changes
The memoryLimit setting allows clients to set a soft memory limit on
the gopls process using
runtime/debug.SetMemoryLimit.
This feature is experimental. It may permit users to trade more CPU
for lower steady state memory usage; but it may cause GC thrashing if
set too low.
The gopls server now enforces
SemanticTokensClientCapabilities
fields: TokenTypes and TokenModifiers. The semantic token types and
modifiers gopls returns are now limited to what these lists contain, so
it’s important that clients fully list their semantic token
capabilities. The gopls UI settings
semanticTokenTypes
and
semanticTokenModifiers
can still be used by users to further restrict these lists.
Web-based features
Editing features
Gopls now supports the Hover request in Go assembly files: hovering over a symbol reports the signature and doc comment of its Go declaration.
Gopls now supports the textDocument/documentHighlight request in Go
assembly files: all occurrences of the symbol, label, or machine
register under the cursor are highlighted within the enclosing TEXT
function, with definitions classified as writes and references as
reads.
Analysis features
ptrtoerror analyzer
This new analyzer reports inconsistent use of a named type E and its
pointer type *E as an error.
slicesclip modernizer
The new slicesclip modernizer suggests replacing a full slice
expression of the form x[:len(x):len(x)], which clips the capacity
of a slice to its length, with the simpler and more readable
slices.Clip(x), added in Go 1.21.
Code transformation features
The source files for this documentation can be found beneath golang.org/x/tools/gopls/doc.