From 04eed7a0d9898a64d5996d339088d4bdc9965d92 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 5 Mar 2025 11:47:20 +0100 Subject: [PATCH] rm unnecessary replace; add a comment with example --- libs/patchwheel/parse.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/patchwheel/parse.go b/libs/patchwheel/parse.go index 7e8b7b69d..96e6834bc 100644 --- a/libs/patchwheel/parse.go +++ b/libs/patchwheel/parse.go @@ -17,10 +17,12 @@ type WheelInfo struct { // The version is updated according to the following rules: // - if there is an existing part after + it is dropped // - append + to version +// +// Example transform: "1.2.3" -> "1.2.3+2025030412345678" func calculateNewVersion(info WheelInfo, mtime time.Time) (newVersion, newFilename string) { baseVersion, _, _ := strings.Cut(info.Version, "+") - dt := strings.Replace(mtime.Format("20060102150405.00"), ".", "", 1) + dt := mtime.Format("20060102150405.00") dt = strings.Replace(dt, ".", "", 1) newVersion = baseVersion + "+" + dt