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: flag documentation #31228

Open Konstantin8105 opened 5 years ago

Konstantin8105 commented 5 years ago

Documentation is not same:

gofmt -h
usage: gofmt [flags] [path ...]                                  -cpuprofile string                                                   write cpu profile to this file                           -d    display diffs instead of rewriting files                 -e    report all errors (not just the first 10 on different lines)                                                            -l    list files whose formatting differs from gofmt's         -r string                                                            rewrite rule (e.g., 'a[b:len(a)] -> a[b:]')              -s    simplify code                                            -w    write result to (source) file instead of stdout

And https://golang.org/cmd/gofmt/

Konstantin8105 commented 5 years ago

Also see go doc cmd/gofmt

DylanMeeus commented 5 years ago

It seems to me that the documentation needs to be updated to match the output from gofmt -h. Rather than having gofmt -h updated to reflect the documentation?

If that's the case, is it OK if I open a PR for this by altering the doc.go in cmd/gofmt? So I have something small to contribute :sweat_smile:

Konstantin8105 commented 5 years ago

Us I understood, gofmt -h is correct, but not correct on other places. Feel free for contribute.

gopherbot commented 5 years ago

Change https://golang.org/cl/170679 mentions this issue: cmd/gofmt: have the doc.go match -h output