gitlab.com/evatix-go/core@v1.3.55/coreversion/hasDeductUsingNilNess.go (about) 1 package coreversion 2 3 import "gitlab.com/evatix-go/core/corecomparator" 4 5 func hasDeductUsingNilNess(left *Version, right *Version) (r corecomparator.Compare, isApplicable bool) { 6 if left == nil && right == nil { 7 return corecomparator.Equal, true 8 } 9 10 if left != nil && right == nil { 11 return corecomparator.LeftGreater, true 12 } 13 14 if left == nil && right != nil { 15 return corecomparator.LeftLess, true 16 } 17 18 if left == nil || right == nil { 19 return corecomparator.NotEqual, true 20 } 21 22 if left == right { 23 return corecomparator.Equal, true 24 } 25 26 if left.VersionCompact == right.VersionCompact { 27 return corecomparator.Equal, true 28 } 29 30 return corecomparator.Inconclusive, false 31 }