The fieldalignment
analyzer, previously disabled by default, has been removed: it is redundant with the hover size/offset information displayed by v0.16.0 and its diagnostics were confusing.
Gopls now offers another code action, “Extract declarations to new file”, which moves selected code sections to a newly created file within the same package. The created filename is chosen as the first {function, type, const, var} name encountered. In addition, import declarations are added or removed as needed.
The user can invoke this code action by selecting a function name, the keywords func
, const
, var
, type
, or by placing the caret on them without selecting, or by selecting a whole declaration or multiple declrations.
In order to avoid ambiguity and surprise about what to extract, some kinds of paritial selection of a declration cannot invoke this code action.
Hovering over a standard library symbol now displays information about the first Go release containing the symbol. For example, hovering over errors.As
shows “Added in go1.13”.