提交 03048fbb 编写于 作者: T Tom Benner

Prevent 'Invalid Version' when Go patch number is missing

上级 a511969a
......@@ -98,10 +98,15 @@ function checkGoVersion() {
deferred.reject(new Error('Go version not found.'));
return;
}
if (semver.lt(match[0], minGoVersion)) {
let currentGoVersion = match[0];
// semver requires a patch number, so we'll append '.0' if it isn't present.
if (currentGoVersion.split('.').length === 2) {
currentGoVersion = `${currentGoVersion}.0`;
}
if (semver.lt(currentGoVersion, minGoVersion)) {
deferred.reject(
new Error(
`The current go version "${match[0]}" is older than ` +
`The current go version "${currentGoVersion}" is older than ` +
`the minimum required version "${minGoVersion}". ` +
`Please upgrade your go version!`));
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册