// uploadVersion returns a copy of the supplied version with a build number // higher than any of the supplied tools that share its major, minor and patch. func uploadVersion(vers version.Number, existing coretools.List) version.Number { vers.Build++ for _, t := range existing { if t.Version.Major != vers.Major || t.Version.Minor != vers.Minor || t.Version.Patch != vers.Patch { continue } if t.Version.Build >= vers.Build { vers.Build = t.Version.Build + 1 } } return vers }
func isCompatibleVersion(v1, v2 version.Number) bool { v1.Build = 0 v2.Build = 0 return v1.Compare(v2) == 0 }