diff --git a/README.md b/README.md index 7c91dc7..25e1751 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Enforce a stricter format than `gofmt`, while being backwards compatible. That is, `gofumpt` is happy with a subset of the formats that `gofmt` is happy with. -The tool is a fork of `gofmt` as of Go 1.19, and requires Go 1.19 or later. +The tool is a fork of `gofmt` as of Go 1.20, and requires Go 1.19 or later. It can be used as a drop-in replacement to format your Go code, and running `gofmt` after `gofumpt` should produce no changes. For example: @@ -15,7 +15,7 @@ For example: gofumpt -l -w . Some of the Go source files in this repository belong to the Go project. -The project includes copies of `go/printer` and `go/doc/comment` as of Go 1.19 +The project includes copies of `go/printer` and `go/doc/comment` as of Go 1.20 to ensure consistent formatting independent of what Go version is being used. The [added formatting rules](#Added-rules) are implemented in the `format` package. diff --git a/gofmt.go b/gofmt.go index 17e22af..1553ae7 100644 --- a/gofmt.go +++ b/gofmt.go @@ -239,7 +239,7 @@ func (r *reporter) getState() *reporterState { // Warnf emits a warning message to the reporter's error stream, // without changing its exit code. -func (r *reporter) Warnf(format string, args ...interface{}) { +func (r *reporter) Warnf(format string, args ...any) { fmt.Fprintf(r.getState().err, format, args...) } @@ -542,7 +542,7 @@ type module struct { } } -func loadModuleInfo(dir string) interface{} { +func loadModuleInfo(dir string) any { cmd := exec.Command("go", "mod", "edit", "-json") cmd.Dir = dir