Skip to content

Commit

Permalink
update cmd/gofmt source with Go 1.20
Browse files Browse the repository at this point in the history
There are no relevant changes. We can start using `any`, though.
  • Loading branch information
mvdan committed Apr 8, 2023
1 parent 24a2b03 commit 086496c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
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:

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.

Expand Down
4 changes: 2 additions & 2 deletions gofmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 086496c

Please sign in to comment.