feat: allow gotests -template_dir argument customization
This commit is contained in:
parent
03cabf675c
commit
5e35bc3fdb
3 changed files with 12 additions and 0 deletions
|
|
@ -39,6 +39,9 @@ require("gopher").setup {
|
|||
impl = "impl",
|
||||
iferr = "iferr",
|
||||
},
|
||||
gotests = {
|
||||
template_dir = "" -- customize gotests -template_dir argument
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,10 @@ local M = {
|
|||
iferr = "iferr",
|
||||
dlv = "dlv",
|
||||
},
|
||||
gotests_args = {
|
||||
---override gotests templates
|
||||
template_dir = "",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ end
|
|||
|
||||
---@param args table
|
||||
local function add_test(args)
|
||||
local c = require("gopher.config").config.gotests
|
||||
if c.template_dir ~= "" then
|
||||
table.insert(args, "-template_dir")
|
||||
table.insert(args, c.template_dir)
|
||||
end
|
||||
local fpath = vim.fn.expand "%" ---@diagnostic disable-line: missing-parameter
|
||||
table.insert(args, "-w")
|
||||
table.insert(args, fpath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue