golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.87k stars 17.52k forks source link

cmd/gofmt: better error message when gofmt is out of date #25430

Open griesemer opened 6 years ago

griesemer commented 6 years ago

It's not uncommon to run an old gofmt that may not be up-to-date with the latest syntactic changes (most recently, alias type declarations). There may be future (Go 2) changes where this becomes more acute.

When gofmt reports a syntax error, we may want to compare the gofmt (build time) version with the current "go version" and possibly report significant version discrepancies with the error ("please update gofmt").

Reminder issue to look into this.

randall77 commented 6 years ago

Also goimports.

griesemer commented 6 years ago

@randall77 Added separate issue #25856.

griesemer commented 6 years ago

The issue for importers has been addressed (#25856). We're probably not going to make major syntactic changes towards Go 2 in 1.12, so postponing for next release.