aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers/go.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/installers/go.lua')
-rw-r--r--lua/nvim-lsp-installer/installers/go.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/installers/go.lua b/lua/nvim-lsp-installer/installers/go.lua
new file mode 100644
index 00000000..f4c85248
--- /dev/null
+++ b/lua/nvim-lsp-installer/installers/go.lua
@@ -0,0 +1,16 @@
+local path = require("nvim-lsp-installer.path")
+local shell = require("nvim-lsp-installer.installers.shell")
+
+local M = {}
+
+function M.packages(packages)
+ return shell.raw(("go get %s"):format(table.concat(packages, " ")), {
+ prefix = [[set -euo pipefail; export GO111MODULE=on; export GOBIN="$PWD"; export GOPATH="$PWD";]]
+ })
+end
+
+function M.executable(root_dir, executable)
+ return path.concat { root_dir, executable }
+end
+
+return M