Skip to content

Commit 086496c

Browse files
committed
update cmd/gofmt source with Go 1.20
There are no relevant changes. We can start using `any`, though.
1 parent 24a2b03 commit 086496c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
Enforce a stricter format than `gofmt`, while being backwards compatible.
88
That is, `gofumpt` is happy with a subset of the formats that `gofmt` is happy with.
99

10-
The tool is a fork of `gofmt` as of Go 1.19, and requires Go 1.19 or later.
10+
The tool is a fork of `gofmt` as of Go 1.20, and requires Go 1.19 or later.
1111
It can be used as a drop-in replacement to format your Go code,
1212
and running `gofmt` after `gofumpt` should produce no changes.
1313
For example:
1414

1515
gofumpt -l -w .
1616

1717
Some of the Go source files in this repository belong to the Go project.
18-
The project includes copies of `go/printer` and `go/doc/comment` as of Go 1.19
18+
The project includes copies of `go/printer` and `go/doc/comment` as of Go 1.20
1919
to ensure consistent formatting independent of what Go version is being used.
2020
The [added formatting rules](#Added-rules) are implemented in the `format` package.
2121

gofmt.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func (r *reporter) getState() *reporterState {
239239

240240
// Warnf emits a warning message to the reporter's error stream,
241241
// without changing its exit code.
242-
func (r *reporter) Warnf(format string, args ...interface{}) {
242+
func (r *reporter) Warnf(format string, args ...any) {
243243
fmt.Fprintf(r.getState().err, format, args...)
244244
}
245245

@@ -542,7 +542,7 @@ type module struct {
542542
}
543543
}
544544

545-
func loadModuleInfo(dir string) interface{} {
545+
func loadModuleInfo(dir string) any {
546546
cmd := exec.Command("go", "mod", "edit", "-json")
547547
cmd.Dir = dir
548548

0 commit comments

Comments
 (0)