mojo/discovery: fixing breaking change for mojo profile 13
MultiPart: 3/3
Change-Id: I48b11595f97440db8205342dd642f74904600544
diff --git a/go/src/v.io/x/mojo/transcoder/internal/internal.vdl.go b/go/src/v.io/x/mojo/transcoder/internal/internal.vdl.go
index 8cb994e..ddd5194 100644
--- a/go/src/v.io/x/mojo/transcoder/internal/internal.vdl.go
+++ b/go/src/v.io/x/mojo/transcoder/internal/internal.vdl.go
@@ -156,7 +156,7 @@
target, err := &t.zipTarget, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.AddressInfo", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *AddressInfoTarget) FinishField(_, _ vdl.Target) error {
@@ -177,7 +177,7 @@
t.Value.Zip = ""
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.AddressInfo", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *AddressInfoTarget) FinishFields(_ vdl.FieldsTarget) error {
@@ -611,7 +611,7 @@
target, err := &t.ratingTarget, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.EquifaxCreditReport", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *EquifaxCreditReportTarget) FinishField(_, _ vdl.Target) error {
@@ -623,7 +623,7 @@
t.Value.Rating = byte(0)
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.EquifaxCreditReport", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *EquifaxCreditReportTarget) FinishFields(_ vdl.FieldsTarget) error {
@@ -760,7 +760,7 @@
target, err := &t.ratingTarget, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.ExperianCreditReport", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *ExperianCreditReportTarget) FinishField(_, _ vdl.Target) error {
@@ -772,7 +772,7 @@
t.Value.Rating = ExperianRatingGood
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.ExperianCreditReport", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *ExperianCreditReportTarget) FinishFields(_ vdl.FieldsTarget) error {
@@ -894,7 +894,7 @@
target, err := &t.ratingTarget, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.TransUnionCreditReport", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *TransUnionCreditReportTarget) FinishField(_, _ vdl.Target) error {
@@ -906,7 +906,7 @@
t.Value.Rating = int16(0)
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.TransUnionCreditReport", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *TransUnionCreditReportTarget) FinishFields(_ vdl.FieldsTarget) error {
@@ -1368,7 +1368,7 @@
target, err := &t.reportTarget, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.CreditReport", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *CreditReportTarget) FinishField(_, _ vdl.Target) error {
@@ -1383,7 +1383,7 @@
t.Value.Report = AgencyReport(AgencyReportEquifaxReport{})
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.CreditReport", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *CreditReportTarget) FinishFields(_ vdl.FieldsTarget) error {
@@ -1629,7 +1629,7 @@
target, err := &t.creditTarget, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.Customer", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *CustomerTarget) FinishField(_, _ vdl.Target) error {
@@ -1655,7 +1655,7 @@
}
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/internal.Customer", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *CustomerTarget) FinishFields(_ vdl.FieldsTarget) error {
diff --git a/go/src/v.io/x/mojo/transcoder/testtypes/testtypes.vdl.go b/go/src/v.io/x/mojo/transcoder/testtypes/testtypes.vdl.go
index 36ea9df..6dd60fa 100644
--- a/go/src/v.io/x/mojo/transcoder/testtypes/testtypes.vdl.go
+++ b/go/src/v.io/x/mojo/transcoder/testtypes/testtypes.vdl.go
@@ -1301,7 +1301,7 @@
target, err := &t.podUnionTarget, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.PodUnionWrapper", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *PodUnionWrapperTarget) FinishField(_, _ vdl.Target) error {
@@ -1313,7 +1313,7 @@
t.Value.PodUnion = PodUnion(PodUnionFInt8{})
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.PodUnionWrapper", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *PodUnionWrapperTarget) FinishFields(_ vdl.FieldsTarget) error {
@@ -1440,7 +1440,7 @@
target, err := &t.fInt8Target, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.DummyStruct", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *DummyStructTarget) FinishField(_, _ vdl.Target) error {
@@ -1452,7 +1452,7 @@
t.Value.FInt8 = int8(0)
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.DummyStruct", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *DummyStructTarget) FinishFields(_ vdl.FieldsTarget) error {
@@ -2117,15 +2117,11 @@
}
} else {
enc.SetNextStartValueIsOptional()
- if err := enc.StartValue(vdl.TypeOf((*DummyStruct)(nil)).Elem()); err != nil {
- return err
- }
+
if err := x.Value.VDLWrite(enc); err != nil {
return err
}
- if err := enc.FinishValue(); err != nil {
- return err
- }
+
}
if err := enc.NextField(""); err != nil {
return err
@@ -2172,9 +2168,6 @@
if err := enc.NextField("FPodUnion"); err != nil {
return err
}
- if err := x.Value.VDLWrite(enc); err != nil {
- return err
- }
switch {
case x.Value == nil:
// Write the zero value of the union type.
@@ -2516,7 +2509,7 @@
target, err := &t.objectUnionTarget, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.ObjectUnionWrapper", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *ObjectUnionWrapperTarget) FinishField(_, _ vdl.Target) error {
@@ -2528,7 +2521,7 @@
t.Value.ObjectUnion = ObjectUnion(ObjectUnionFInt8{})
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.ObjectUnionWrapper", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *ObjectUnionWrapperTarget) FinishFields(_ vdl.FieldsTarget) error {
@@ -2730,7 +2723,7 @@
target, err := &t.heightTarget, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.Rect", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *RectTarget) FinishField(_, _ vdl.Target) error {
@@ -2751,7 +2744,7 @@
t.Value.Height = int32(0)
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.Rect", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *RectTarget) FinishFields(_ vdl.FieldsTarget) error {
@@ -3111,7 +3104,7 @@
target, err := &t.fInt16Target, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.MultiVersionStruct", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *MultiVersionStructTarget) FinishField(_, _ vdl.Target) error {
@@ -3138,7 +3131,7 @@
t.Value.FInt16 = int16(0)
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.MultiVersionStruct", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *MultiVersionStructTarget) FinishFields(_ vdl.FieldsTarget) error {
@@ -3443,7 +3436,7 @@
target, err := &t.fStringTarget, error(nil)
return nil, target, err
default:
- return nil, nil, fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.MultiVersionStructV3", name)
+ return nil, nil, vdl.ErrFieldNoExist
}
}
func (t *MultiVersionStructV3Target) FinishField(_, _ vdl.Target) error {
@@ -3461,7 +3454,7 @@
t.Value.FString = ""
return nil
default:
- return fmt.Errorf("field %s not in struct src/v.io/x/mojo/transcoder/testtypes.MultiVersionStructV3", name)
+ return vdl.ErrFieldNoExist
}
}
func (t *MultiVersionStructV3Target) FinishFields(_ vdl.FieldsTarget) error {
diff --git a/go/src/v.io/x/mojo/transcoder/type.go b/go/src/v.io/x/mojo/transcoder/type.go
index de7f522..298347a 100644
--- a/go/src/v.io/x/mojo/transcoder/type.go
+++ b/go/src/v.io/x/mojo/transcoder/type.go
@@ -343,9 +343,8 @@
enumValues := make([]mojom_types.EnumValue, t.NumEnumLabel())
for i := 0; i < t.NumEnumLabel(); i++ {
enumValues[i] = mojom_types.EnumValue{
- DeclData: &mojom_types.DeclarationData{ShortName: strPtr(t.EnumLabel(i))},
- IntValue: int32(i),
- EnumTypeKey: mojomTypeKey(t),
+ DeclData: &mojom_types.DeclarationData{ShortName: strPtr(t.EnumLabel(i))},
+ IntValue: int32(i),
}
}
_, name := vdl.SplitIdent(t.Name())