зеркало из https://github.com/golang/tools.git
inline: make it possible to gob encode/decode inlineMeFacts
Before this change gob encoding of these facts was failing with: `gob: type analyzer.inlineMeFact has no exported fields` gob encoding is required for all facts as analyzer drivers use it to share facts between the analysis of different packages as stated in the docs: A Fact type must be a pointer. Facts are encoded and decoded using encoding/gob. A Fact may implement the GobEncoder/GobDecoder interfaces to customize its encoding. Fact encoding should not fail. Change-Id: Ifb0eb57b0f582ec228a21a0d17e3bbd33c560d3d Reviewed-on: https://go-review.googlesource.com/c/tools/+/574435 Auto-Submit: Lasse Folger <lassefolger@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Родитель
db5d12bad8
Коммит
867c912ea6
|
@ -104,7 +104,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
|
|||
if !ok {
|
||||
var fact inlineMeFact
|
||||
if pass.ImportObjectFact(fn, &fact) {
|
||||
callee = fact.callee
|
||||
callee = fact.Callee
|
||||
inlinable[fn] = callee
|
||||
}
|
||||
}
|
||||
|
@ -157,9 +157,9 @@ func run(pass *analysis.Pass) (interface{}, error) {
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
type inlineMeFact struct{ callee *inline.Callee }
|
||||
type inlineMeFact struct{ Callee *inline.Callee }
|
||||
|
||||
func (f *inlineMeFact) String() string { return "inlineme " + f.callee.String() }
|
||||
func (f *inlineMeFact) String() string { return "inlineme " + f.Callee.String() }
|
||||
func (*inlineMeFact) AFact() {}
|
||||
|
||||
func discard(string, ...any) {}
|
||||
|
|
Загрузка…
Ссылка в новой задаче