use `-1` for random port

pull/87/head
ray-x 2 years ago
parent ee3c36e25d
commit a853613467

@ -40,7 +40,7 @@ _GO_NVIM_CFG = {
dap_debug_keymap = true, -- true: use keymap for debugger defined in go/dap.lua
-- false: do not use keymap in go/dap.lua. you must define your own.
dap_vt = true, -- false, true and 'all frames'
dap_port = 38697, -- can be set to a number or 'random' so go.nvim will pickup a random port
dap_port = 38697, -- can be set to a number or `-1` so go.nvim will pickup a random port
build_tags = "", --- you can provide extra build tags for tests or debugger
textobjects = true,
test_runner = "go", -- richgo, go test, richgo, dlv, ginkgo

@ -136,7 +136,7 @@ M.run = function(...)
end
local port = 38697
if _GO_NVIM_CFG.dap_port == "random" then
if _GO_NVIM_CFG.dap_port == -1 then
math.randomseed(os.time())
port = 38000 + math.random(1, 1000)
end

Loading…
Cancel
Save