// 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 tools.List) version.Number { vers.Build++ for _, t := range existing { if t.Major != vers.Major || t.Minor != vers.Minor || t.Patch != vers.Patch { continue } if t.Build >= vers.Build { vers.Build = t.Build + 1 } } return vers }