quaint-telephone-89068
03/06/2023, 9:26 PMusage: 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 (
-e, -r, and -s are useful to let users set. But the others probably should not be allowed. Two ways to model that:
a) having an --args option and validating -w etc are not set
b) having dedicated options like --gofmt-simplify
I suspect the --args option is the most idiomatic for Pants.
pantsbuild/pantsuser
03/06/2023, 9:26 PM