Skip to content

Commit 867c912

Browse files
lfolgergopherbot
authored andcommitted
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 <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent db5d12b commit 867c912

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/refactor/inline/analyzer/analyzer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
104104
if !ok {
105105
var fact inlineMeFact
106106
if pass.ImportObjectFact(fn, &fact) {
107-
callee = fact.callee
107+
callee = fact.Callee
108108
inlinable[fn] = callee
109109
}
110110
}
@@ -157,9 +157,9 @@ func run(pass *analysis.Pass) (interface{}, error) {
157157
return nil, nil
158158
}
159159

160-
type inlineMeFact struct{ callee *inline.Callee }
160+
type inlineMeFact struct{ Callee *inline.Callee }
161161

162-
func (f *inlineMeFact) String() string { return "inlineme " + f.callee.String() }
162+
func (f *inlineMeFact) String() string { return "inlineme " + f.Callee.String() }
163163
func (*inlineMeFact) AFact() {}
164164

165165
func discard(string, ...any) {}

0 commit comments

Comments
 (0)