all repos

gopher.nvim @ 932c0aa0c334ad384e2a1368d53f49bf52a4f80d

Minimalistic plugin for Go development
2 files changed, 7 insertions(+), 11 deletions(-)
refactor(installer): return function instead of M
Author: Smirnov Olexander ss2316544@gmail.com
Committed at: 2022-06-17 22:32:41 +0300
Parent: bc235b7
M lua/gopher/init.lua

@@ -1,7 +1,7 @@

local tags = require "gopher.struct_tags" local gopher = {} -gopher.install_deps = require("gopher.installer").install_all +gopher.install_deps = require "gopher.installer" gopher.tags_add = tags.add gopher.tags_rm = tags.remove gopher.mod = require "gopher.gomod"
M lua/gopher/installer.lua

@@ -1,13 +1,11 @@

local Job = require "plenary.job" -local M = { - urls = { - gomodifytags = "github.com/fatih/gomodifytags", - impl = "github.com/josharian/impl", - }, +local urls = { + gomodifytags = "github.com/fatih/gomodifytags", + impl = "github.com/josharian/impl", } local function install(pkg) - local url = M.urls[pkg] .. "@latest" + local url = urls[pkg] .. "@latest" Job :new({

@@ -26,10 +24,8 @@ :sync()

end ---Install required go deps -function M.install_all() - for pkg, _ in pairs(M.urls) do +return function() + for pkg, _ in pairs(urls) do install(pkg) end end - -return M