From cfeab3d398b6cfadc6a1abc1d94ed0f6bdd8973f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Brelih?= Date: Mon, 29 Nov 2021 13:09:30 +0100 Subject: [PATCH] fix: build tags was missing space (#46) * fix: build tags was missing space * if run in floaterm, '\ ' may cause error Thanks for the PR. I did some update please check if it works Co-authored-by: Ales Brelih Co-authored-by: rayx --- README.md | 1 + lua/go/gotest.lua | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 24537ed..98cad71 100644 --- a/README.md +++ b/README.md @@ -363,6 +363,7 @@ require('go').setup({ dap_debug_keymap = true, -- set keymaps for debugger dap_debug_gui = true, -- set to true to enable dap gui, highly recommand dap_debug_vt = true, -- set to true to enable dap virtual text + build_tags = "tag1,tag2" -- set default build tags }) ``` diff --git a/lua/go/gotest.lua b/lua/go/gotest.lua index 85f6fa6..5af175b 100644 --- a/lua/go/gotest.lua +++ b/lua/go/gotest.lua @@ -6,8 +6,12 @@ local ginkgo = require("go.ginkgo") local function get_build_tags(args) local tags = "-tags" + local space = [[\ ]] + if _GO_NVIM_CFG.run_in_floaterm then + space = ' ' + end if _GO_NVIM_CFG.build_tags ~= "" then - tags = tags .. _GO_NVIM_CFG.build_tags + tags = tags .. space .. _GO_NVIM_CFG.build_tags end for i, value in pairs(args) do @@ -25,7 +29,7 @@ local function get_build_tags(args) tags = '' end - return tags, args + return space .. tags .. space, args end M.get_build_tags = get_build_tags