From 953f0b309ce3f51306706ac7e7863e9f5eaa3cf4 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Thu, 6 Jan 2022 23:42:29 +1100 Subject: [PATCH] fix: ensure version parts have enough elements not to panic --- manifest/version.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifest/version.go b/manifest/version.go index b9238972..78eed552 100644 --- a/manifest/version.go +++ b/manifest/version.go @@ -49,6 +49,9 @@ func ParseVersion(version string) Version { if parts[3] != "" { prerelease = versionPartsRe.Split(parts[3], -1) } + for len(parts) < 6 { + parts = append(parts, "") + } metadata = parts[5] return Version{ orig: parts[1:],