This results in gofumpt having to fall back to assuming the code has to comply with Go 1.0 as a language, not enabling rules which affect newer language features such as octal numbers.
This should be an easy fix, I think. When run from the command line, gofumpt uses the version specified in go.mod, so gopls could do the same.
The text was updated successfully, but these errors were encountered:
gopherbot
added
Tools
This label describes issues relating to any tools in the x/tools repository.
gopls
Issues related to the Go language server, gopls.
labels
Jan 29, 2021
If possible, this would be a good opportunity for a general mechanism to wire passing flags through gopls to formatters (so, for example with gofumpt, -extra).
gofumpt's API has an option to specify the Go language version to target: https://pkg.go.dev/mvdan.cc/gofumpt/format#Options
Unfortunately, this seems to not be wired into gopls: https://github.com/golang/tools/blob/e9a2c0706a5b9cc8ee5965d5a50c996ffb255a7b/gopls/internal/hooks/hooks.go#L26
This results in gofumpt having to fall back to assuming the code has to comply with Go 1.0 as a language, not enabling rules which affect newer language features such as octal numbers.
This should be an easy fix, I think. When run from the command line,
gofumpt
uses the version specified ingo.mod
, so gopls could do the same.cc @stamblerre @ianthehat
The text was updated successfully, but these errors were encountered: