@@ -54,7 +54,7 @@ type lensID struct {
54
54
From , To SyntacticVersion
55
55
}
56
56
57
- func lid (to , from SyntacticVersion ) lensID {
57
+ func lid (from , to SyntacticVersion ) lensID {
58
58
return lensID {from , to }
59
59
}
60
60
@@ -218,7 +218,7 @@ func (ml *maybeLineage) checkGoLensCompleteness() error {
218
218
// TODO(sdboyer) it'd be nice to consolidate all the errors so that the user always sees a complete set of problems
219
219
all := make (map [lensID ]bool )
220
220
for _ , lens := range ml .implens {
221
- id := lid (lens .To , lens .From )
221
+ id := lid (lens .From , lens .To )
222
222
if all [id ] {
223
223
return fmt .Errorf ("duplicate Go migration %s" , id )
224
224
}
@@ -234,7 +234,7 @@ func (ml *maybeLineage) checkGoLensCompleteness() error {
234
234
for _ , sch := range ml .schlist [1 :] {
235
235
// there must always at least be a reverse lens
236
236
v := sch .Version ()
237
- revid := lid (prior , v )
237
+ revid := lid (v , prior )
238
238
239
239
if ! all [revid ] {
240
240
missing = append (missing , revid )
@@ -244,7 +244,7 @@ func (ml *maybeLineage) checkGoLensCompleteness() error {
244
244
245
245
if v [0 ] != prior [0 ] {
246
246
// if we crossed a major version, there must also be a forward lens
247
- fwdid := lid (v , prior )
247
+ fwdid := lid (prior , v )
248
248
if ! all [fwdid ] {
249
249
missing = append (missing , fwdid )
250
250
} else {
@@ -272,7 +272,7 @@ func (ml *maybeLineage) checkGoLensCompleteness() error {
272
272
// walk the slice so output is reliably ordered
273
273
for _ , lens := range ml .implens {
274
274
// if it's not in the list it's because it was expected & already processed
275
- elid := lid (lens .To , lens .From )
275
+ elid := lid (lens .From , lens .To )
276
276
if _ , has := all [elid ]; ! has {
277
277
continue
278
278
}
@@ -301,7 +301,7 @@ func (ml *maybeLineage) checkGoLensCompleteness() error {
301
301
302
302
ml .lensmap = make (map [lensID ]ImperativeLens , len (ml .implens ))
303
303
for _ , lens := range ml .implens {
304
- ml .lensmap [lid (lens .To , lens .From )] = lens
304
+ ml .lensmap [lid (lens .From , lens .To )] = lens
305
305
}
306
306
307
307
return nil
0 commit comments