mirror of https://github.com/databricks/cli.git
use strings.Cut
This commit is contained in:
parent
fe275654fb
commit
704bb5cb0e
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue