ray-x / go.nvim

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

gofumpt/golines/goimports failed 1/2 #519

Open nrydanov opened 3 weeks ago

nrydanov commented 3 weeks ago

I constantly get messages like gofumpt failed 2 on save.

I see [Wed Nov 6 00:28:27 2024 582068]  ....living/.local/share/nvim/lazy/go.nvim/lua/go/format.lua:75 |1: { "stat /Users/find.art.in.living/Documents/dev/work/orb/runner/cmd/main.go: no such file or directory" } from stderr in logs.

However, this path exists if I just copy it and open Neovim, for example.

my go.nvim config

return {
    "ray-x/go.nvim",

    event = { "CmdlineEnter" },
    config = function()
        require("go").setup({
            goimports = "golines",
             verbose = true,
                gofmt = "gofumpt",
                log_path = vim.fn.expand("$HOME") .. "/tmp/gonvim.log",
            lsp_cfg = true,
            lsp_inlay_hints = {
                enable = false,
            }
        })

        local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {})
        vim.api.nvim_create_autocmd("BufWritePre", {
            pattern = "*.go",
            callback = function()
                require('go.format').gofmt()
            end,
            group = format_sync_grp,
        })
    end,
    ft = { "go", 'gomod' },
}
ray-x commented 3 weeks ago

The configuration looks fine. Is the file linked to another file or is it in a cloud shared folder?

nrydanov commented 3 weeks ago

The configuration looks fine. Is the file linked to another file or is it in a cloud shared folder?

It is existing file on my local drive.