go.nvim icon indicating copy to clipboard operation
go.nvim copied to clipboard

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

Open skalle opened this issue 1 year ago • 2 comments

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.

skalle avatar Jun 04 '24 22:06 skalle

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

ray-x avatar Jun 04 '24 23:06 ray-x

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

skalle avatar Jun 05 '24 08:06 skalle