@@ -381,15 +381,15 @@ func (s *S) TestPlanExtensions(c *C) {
381381 if _ , ok := planTest .extensions [xField ]; ok {
382382 // Verify "x-field" data.
383383 var x * xSection
384- err = p .Section (xField , & x )
384+ x = p .Section (xField ).( * xSection )
385385 c .Assert (err , IsNil )
386386 c .Assert (x .Entries , DeepEquals , planTest .combinedPlanResult .x .Entries )
387387 }
388388
389389 if _ , ok := planTest .extensions [yField ]; ok {
390390 // Verify "y-field" data.
391391 var y * ySection
392- err = p .Section (yField , & y )
392+ y = p .Section (yField ).( * ySection )
393393 c .Assert (err , IsNil )
394394 c .Assert (y .Entries , DeepEquals , planTest .combinedPlanResult .y .Entries )
395395 }
@@ -451,19 +451,10 @@ func (x xExtension) CombineSections(sections ...plan.LayerSection) (plan.LayerSe
451451
452452func (x xExtension ) ValidatePlan (p * plan.Plan ) error {
453453 var xs * xSection
454- err := p .Section (xField , & xs )
455- if err != nil {
456- return err
457- }
454+ xs = p .Section (xField ).(* xSection )
458455 if xs != nil {
459456 var ys * ySection
460- err = p .Section (yField , & ys )
461- if err != nil {
462- return err
463- }
464- if ys == nil {
465- return fmt .Errorf ("cannot validate %v field without %v field" , xField , yField )
466- }
457+ ys = p .Section (yField ).(* ySection )
467458
468459 // Test dependency: Make sure every Y field in X refer to an existing Y entry.
469460 for xEntryField , xEntryValue := range xs .Entries {
0 commit comments