ray-x / go.nvim

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

Provide a way to run alternate command for eg. go and go test #471

Open skalle opened 1 month ago

skalle commented 1 month ago

I'm using bazel.io for a Go project which gives that you usually want to wrap go commands in something like:

$ bazel run @rules_go/go -- mod tidy

It'd be great to be able to provide an alternate go command used in go.nvim.

ray-x commented 1 month ago

There is a setting go = 'go', -- set to go1.18beta1 if necessary You may want to do this go = 'bazel',

But, ATM the command have to be fully compatible with go

skalle commented 1 month ago

Hey @ray-x .

I tried that but got errors: unknown option run

This with the following configuration:

      require('go').setup {
        disable_defaults = false,
        luasnip = true,
        go = 'bazel run @rules_go//go --',
     }

bazel will run the go command so whatever is after the -- will be working the same as vanilla go