golang/go

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

Chiusa

#79.801 aperta il 3 giu 2026

 (3 commenti) (0 reazioni) (1 assegnatario)Go (19.008 fork)batch import
AnalysisToolsgoplshelp wanted

Metriche repository

Star
 (133.883 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor