aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-05-13 21:01:24 +0200
committerGitHub <noreply@github.com>2022-05-13 21:01:24 +0200
commitb1f1200cb25bcaa05811b238584ed27dcd6d6828 (patch)
tree3f151ec514b01dbc794bac9c29646fa89a2aa48e /lua
parentfix(github): allow looking for prereleases (#699) (diff)
downloadmason-b1f1200cb25bcaa05811b238584ed27dcd6d6828.tar
mason-b1f1200cb25bcaa05811b238584ed27dcd6d6828.tar.gz
mason-b1f1200cb25bcaa05811b238584ed27dcd6d6828.tar.bz2
mason-b1f1200cb25bcaa05811b238584ed27dcd6d6828.tar.lz
mason-b1f1200cb25bcaa05811b238584ed27dcd6d6828.tar.xz
mason-b1f1200cb25bcaa05811b238584ed27dcd6d6828.tar.zst
mason-b1f1200cb25bcaa05811b238584ed27dcd6d6828.zip
fix(go): target the @latest version when checking if package is outdated (#700)
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer/core/managers/go/init.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/lua/nvim-lsp-installer/core/managers/go/init.lua b/lua/nvim-lsp-installer/core/managers/go/init.lua
index 40136b25..067cff58 100644
--- a/lua/nvim-lsp-installer/core/managers/go/init.lua
+++ b/lua/nvim-lsp-installer/core/managers/go/init.lua
@@ -100,13 +100,12 @@ function M.check_outdated_primary_package(receipt, install_dir)
"list",
"-json",
"-m",
- "-versions",
- receipt.primary_source.package,
+ ("%s@latest"):format(receipt.primary_source.package),
cwd = install_dir,
}):map_catching(function(result)
- ---@type {Path: string, Versions: string[]}
+ ---@type {Path: string, Version: string}
local output = vim.json.decode(result.stdout)
- return Optional.of_nilable(output.Versions[#output.Versions])
+ return Optional.of_nilable(output.Version)
:map(function(latest_version)
local installed_version = M.get_installed_primary_package_version(receipt, install_dir):get_or_throw()
if installed_version ~= latest_version then