You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import (
...
mymodule/mypackage
...
)
gets formatted in a separate block when running like gofumpt myfile.go
but cat myfile.go formats differently
in both cases the current working directory is the package for mayflie.go and that package is in the same module
See #117 (comment). Your module path should contain a dot, otherwise we assume that it's the standard library. An exception is when we are formatting inside a Go module, in which case we know the module path and we group its packages separately. This does not happen when formatting standard input, since it's only files on disk which can be part of a module.
using v0.5.0
import (
...
mymodule/mypackage
...
)
gets formatted in a separate block when running like
gofumpt myfile.go
but
cat myfile.go
formats differentlyin both cases the current working directory is the package for mayflie.go and that package is in the same module
I ran across this with null-ls integration at https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/lua/null-ls/builtins/formatting/gofumpt.lua uses stdin. There it uses stdin with the new file contents (can't use the file argument as the file is the old contents).
using stdin in the uql directory
using filename in the uql directory
The text was updated successfully, but these errors were encountered: