ray-x / go.nvim

G'day Nvimer, Joyful Gopher: Discover the Feature-Rich Go Plugin for Neovim
MIT License
2.06k stars 123 forks source link

gopls build flags being overriden with `nil` during lazy startup #323

Closed danielrs closed 1 year ago

danielrs commented 1 year ago

I noticed that when you open a file with no build tags, the buildFlags setting for gopls gets overwritten with nil tags, ignoring even whatever you have in your .gonvim/init.lua. The problem seems to be this part: https://github.com/ray-x/go.nvim/blob/d7530aea0f1086d10e9267287966702616c366af/lua/go/gopls.lua#L298-L301 When the function get_build_tags returns nil, the condition nil ~= '' will always evaluate to true.

Already working on a PR to fix this.

ray-x commented 1 year ago

thanks!