From 96a98e9fb3cfbc19e2ea5bf906315aebaa0cc6f5 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Mon, 21 Dec 2020 20:35:56 +0300 Subject: [PATCH] Update go-parser.psm1 --- get-new-tool-versions/parsers/go-parser.psm1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/get-new-tool-versions/parsers/go-parser.psm1 b/get-new-tool-versions/parsers/go-parser.psm1 index 6091555..76c7130 100644 --- a/get-new-tool-versions/parsers/go-parser.psm1 +++ b/get-new-tool-versions/parsers/go-parser.psm1 @@ -15,7 +15,8 @@ class GoVersionsParser: BaseVersionsParser { hidden [SemVer] FormatVersion([string]$VersionSpec) { $cleanVersion = $VersionSpec -replace "^go", "" - return [SemVer]$cleanVersion + $semanticVersion = $cleanVersion -replace "(\d+\.\d+\.?\d+?)((?:alpha|beta|rc))(\d*)",'$1-$2.$3' + return [SemVer]$semanticVersion } hidden [bool] ShouldIncludeVersion([SemVer]$Version) {