Skip to content

Commit

Permalink
feat: export version comparison utility function
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Lock <[email protected]>
  • Loading branch information
joshuagl committed Jun 21, 2022
1 parent 596fab5 commit 89bb6cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func hashEqual(actual data.Hashes, expected data.Hashes) error {
return nil
}

func versionEqual(actual int64, expected int64) error {
func VersionEqual(actual int64, expected int64) error {
if actual != expected {
return ErrWrongVersion{expected, actual}
}
Expand All @@ -152,7 +152,7 @@ func SnapshotFileMetaEqual(actual data.SnapshotFileMeta, expected data.SnapshotF
}
}
// 5.6.4 - Check against snapshot role's snapshot version
if err := versionEqual(actual.Version, expected.Version); err != nil {
if err := VersionEqual(actual.Version, expected.Version); err != nil {
return err
}

Expand All @@ -176,7 +176,7 @@ func TimestampFileMetaEqual(actual data.TimestampFileMeta, expected data.Timesta
}
}
// 5.5.4 - Check against timestamp role's snapshot version
if err := versionEqual(actual.Version, expected.Version); err != nil {
if err := VersionEqual(actual.Version, expected.Version); err != nil {
return err
}

Expand Down

0 comments on commit 89bb6cd

Please sign in to comment.