Skip to content

Commit 13527b9

Browse files
committed
remove unused code
Signed-off-by: dongjiang <[email protected]>
1 parent 85854e4 commit 13527b9

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

tools/setup-envtest/versions/misc_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ var _ = Describe("Concrete", func() {
3636
Describe("when ordering relative to other versions", func() {
3737
ver1163 := Concrete{Major: 1, Minor: 16, Patch: 3}
3838
Specify("newer patch should be newer", func() {
39-
Expect(ver1163.NewerThan(Concrete{Major: 1, Minor: 16})).To(BeTrue())
39+
Expect(ver1163.Compare(Concrete{Major: 1, Minor: 16})).To(Equal(1))
4040
})
4141
Specify("newer minor should be newer", func() {
42-
Expect(ver1163.NewerThan(Concrete{Major: 1, Minor: 15, Patch: 3})).To(BeTrue())
42+
Expect(ver1163.Compare(Concrete{Major: 1, Minor: 15, Patch: 3})).To(Equal(1))
4343
})
4444
Specify("newer major should be newer", func() {
45-
Expect(ver1163.NewerThan(Concrete{Major: 0, Minor: 16, Patch: 3})).To(BeTrue())
45+
Expect(ver1163.Compare(Concrete{Major: 0, Minor: 16, Patch: 3})).To(Equal(1))
4646
})
4747
})
4848
})

tools/setup-envtest/versions/version.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ func (c Concrete) Compare(other Concrete) int {
4747
return IntCompare(c.Patch, other.Patch)
4848
}
4949

50-
// NewerThan checks if the given other version is newer than this one.
51-
func (c Concrete) NewerThan(other Concrete) bool {
52-
if c.Major != other.Major {
53-
return c.Major > other.Major
54-
}
55-
if c.Minor != other.Minor {
56-
return c.Minor > other.Minor
57-
}
58-
return c.Patch > other.Patch
59-
}
60-
6150
// Matches checks if this version is equal to the other one.
6251
func (c Concrete) Matches(other Concrete) bool {
6352
return c == other

0 commit comments

Comments
 (0)