gofumpt/golines/goimports failed 1/2
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' },
}
The configuration looks fine. Is the file linked to another file or is it in a cloud shared folder?
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.
Same error when using goimports imports option.
[Fri 27 Dec 2024 10:45:27 PM MSK 80466] ...re/nvim/site/pack/packer/start/go.nvim/lua/go/format.lua:156 |1: imports |2: {}
|3: goimports
[Fri 27 Dec 2024 10:45:27 PM MSK 80515] ...re/nvim/site/pack/packer/start/go.nvim/lua/go/format.lua:35 |1: {}
|2: 2 |3: goimports
[Fri 27 Dec 2024 10:45:27 PM MSK 94510] ...re/nvim/site/pack/packer/start/go.nvim/lua/go/format.lua:50 |1: formatting buffer... { "/home/username/project/internal/pkg/service/processor/bridge/bridge.go" } |2: 1
[Fri 27 Dec 2024 10:45:27 PM MSK 94557] ...re/nvim/site/pack/packer/start/go.nvim/lua/go/format.lua:54 |1: fmt cmd: |2: { "goimports", "/home/username/project/internal/pkg/service/processor/bridge/bridge.go" }
[Fri 27 Dec 2024 10:45:27 PM MSK 109606] ...re/nvim/site/pack/packer/start/go.nvim/lua/go/format.lua:75 |1: { "stat /home/username/project/internal/pkg/service/processor/bridge/bridge.go: no such file or directory" } from stderr
When running commands from the command line,
goimports /home/username/project/internal/pkg/service/processor/bridge/bridge.go
stat /home/username/project/internal/pkg/service/processor/bridge/bridge.go
Is the output expected?
Yes, it is