func Encode(pair Pair) Version {
	widthMinor := maxWidth(pair.First.Minor, pair.Second.Minor)
	widthPatch := maxWidth(pair.First.Patch, pair.Second.Patch)
	formatMinor := strings.ReplaceAll("x%0xd%0xd", "x", strconv.Itoa(widthMinor))
	formatPatch := strings.ReplaceAll("x%0xd%0xd", "x", strconv.Itoa(widthPatch))
	minorStr := fmt.Sprintf(formatMinor, pair.First.Minor, pair.Second.Minor)
	patchStr := fmt.Sprintf(formatPatch, pair.First.Patch, pair.Second.Patch)
	minor := mustAtoi(minorStr)
	patch := mustAtoi(patchStr)

	return Version{
		Major: pair.First.Major,
		Minor: minor,
		Patch: patch,
	}
}
// Encode encodes two semver versions that share the same major version
// into one.
// The encoded version can be decoded back to the originals using Decode.
Encode encodes two semver versions that share the same major version
into one.
The encoded version can be decoded back to the originals using Decode.
// Encode encodes two semver versions that share the same major version // into one . // The encoded version can be decoded back to the originals using Decode .
func Encode(pair Pair) Version {
	widthMinor := maxWidth(pair.First.Minor, pair.Second.Minor)
	widthPatch := maxWidth(pair.First.Patch, pair.Second.Patch)
	formatMinor := strings.ReplaceAll("x%0xd%0xd", "x", strconv.Itoa(widthMinor))
	formatPatch := strings.ReplaceAll("x%0xd%0xd", "x", strconv.Itoa(widthPatch))
	minorStr := fmt.Sprintf(formatMinor, pair.First.Minor, pair.Second.Minor)
	patchStr := fmt.Sprintf(formatPatch, pair.First.Patch, pair.Second.Patch)
	minor := mustAtoi(minorStr)
	patch := mustAtoi(patchStr)
	return Version{
		Major: pair.First.Major,
		Minor: minor,
		Patch: patch,
	}
}
func Encode ( pair Pair ) Version { widthMinor := maxWidth ( pair . First . Minor , pair . Second . Minor ) widthPatch := maxWidth ( pair . First . Patch , pair . Second . Patch ) formatMinor := strings . ReplaceAll ( " " , " " , strconv . Itoa ( widthMinor ) ) formatPatch := strings . ReplaceAll ( " " , " " , strconv . Itoa ( widthPatch ) ) minorStr := fmt . Sprintf ( formatMinor , pair . First . Minor , pair . Second . Minor ) patchStr := fmt . Sprintf ( formatPatch , pair . First . Patch , pair . Second . Patch ) minor := mustAtoi ( minorStr ) patch := mustAtoi ( patchStr ) return Version { Major : pair . First . Major , Minor : minor , Patch : patch , } }
Encode encodes two semver versions that share the same major version
into one.
Encode encodes two semver versions that share the same major version into one .