use strings.Cut

This commit is contained in:
Denis Bilenko 2025-03-05 11:45:51 +01:00
parent fe275654fb
commit 704bb5cb0e
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ type WheelInfo struct {
// - if there is an existing part after + it is dropped // - if there is an existing part after + it is dropped
// - append +<mtime of the original wheel> to version // - append +<mtime of the original wheel> to version
func calculateNewVersion(info WheelInfo, mtime time.Time) (newVersion, newFilename string) { func calculateNewVersion(info WheelInfo, mtime time.Time) (newVersion, newFilename string) {
baseVersion := strings.SplitN(info.Version, "+", 2)[0] baseVersion, _, _ := strings.Cut(info.Version, "+")
dt := strings.Replace(mtime.Format("20060102150405.00"), ".", "", 1) dt := strings.Replace(mtime.Format("20060102150405.00"), ".", "", 1)
dt = strings.Replace(dt, ".", "", 1) dt = strings.Replace(dt, ".", "", 1)