7 type rpcFriendlyDiag struct {
15 // rpcFriendlyDiag transforms a given diagnostic so that is more friendly to
18 // In particular, it currently returns an object that can be serialized and
19 // later re-inflated using gob. This definition may grow to include other
20 // serializations later.
21 func makeRPCFriendlyDiag(diag Diagnostic) Diagnostic {
22 desc := diag.Description()
23 source := diag.Source()
24 return &rpcFriendlyDiag{
25 Severity_: diag.Severity(),
26 Summary_: desc.Summary,
28 Subject_: source.Subject,
29 Context_: source.Context,
33 func (d *rpcFriendlyDiag) Severity() Severity {
37 func (d *rpcFriendlyDiag) Description() Description {
44 func (d *rpcFriendlyDiag) Source() Source {
51 func (d rpcFriendlyDiag) FromExpr() *FromExpr {
52 // RPC-friendly diagnostics cannot preserve expression information because
53 // expressions themselves are not RPC-friendly.
58 gob.Register((*rpcFriendlyDiag)(nil))