golang/go

x/tools/gopls/internal/analysis/deprecated: support fields too

Closed

#79,801 opened on Jun 3, 2026

 (3 comments) (0 reactions) (1 assignee)Go (19,008 forks)batch import
AnalysisToolsgoplshelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

gopls' deprecated analyzer reports a diagnostic for each reference to a deprecated package-level symbol or concrete method. (It uses the LSP's hint severity and deprecated tag to make it subtle.) However, it does not report references to deprecated fields, such as the Obj field of ast.Ident, declared thus:

	// An Ident node represents an identifier.
	Ident struct {
		NamePos token.Pos // identifier position
		Name    string    // identifier name
		Obj     *Object   // denoted object, or nil. Deprecated: see Object.
	}

It should support field references too. And interface methods.

Contributor guide