Skip to content

Commit f3771da

Browse files
committed
Use vim.version to compare verions
1 parent d5fa4d4 commit f3771da

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

lua/gitlab/version.lua

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ M.is_go_valid = function()
66
return false
77
end
88

9-
local go_version = go:wait().stdout;
10-
local major, minor, _ = go_version:match("(%d+)%.(%d+)%.?(%d*)")
11-
if major and tonumber(major) >= 1 and tonumber(minor) >= 25 then
12-
return true
13-
else
14-
return false
15-
end
9+
local go_version = vim.version.parse(go:wait().stdout, { strict = false })
10+
return vim.version.ge(go_version, { 1, 25, 0 })
1611
end
1712

1813
M.check_go_version = function()

0 commit comments

Comments
 (0)