golang/go

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

已关闭

#79,801 创建于 2026年6月3日

 (3 条评论) (0 个反应) (1 位负责人)Go (19,008 个派生)batch import
AnalysisToolsgoplshelp wanted

仓库指标

星标
 (133,883 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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.

贡献者指南