HEXONET: Adopt diff2 in compatibility mode
@@ -75,16 +75,18 @@ func (n *HXClient) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Corr
txtutil.SplitSingleLongTxt(dc.Records)
var corrections []*models.Correction
- if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
-
+ var create, del, mod diff.Changeset
+ if !diff2.EnableDiff2 {
differ := diff.New(dc)
- _, create, del, mod, err := differ.IncrementalDiff(actual)
+ _, create, del, mod, err = differ.IncrementalDiff(actual)
+ } else {
+ differ := diff.NewCompat(dc)
+ _, create, del, mod, err = differ.IncrementalDiff(actual)
+ }
if err != nil {
return nil, err
}
- corrections := []*models.Correction{}
-
buf := &bytes.Buffer{}
// Print a list of changes. Generate an actual change that is the zone
changes := false
@@ -133,10 +135,6 @@ func (n *HXClient) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Corr
},
})
}
- return corrections, nil
- }
-
- // Insert Future diff2 version here.
return corrections, nil
}
