Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/gofmt: add strongly simplify flag #9983

Closed
josharian opened this issue Feb 24, 2015 · 3 comments
Closed

cmd/gofmt: add strongly simplify flag #9983

josharian opened this issue Feb 24, 2015 · 3 comments

Comments

@josharian
Copy link
Contributor

@griesemer wrote in #9966:

I have long advocated a -ss mode ("strong simplify") which could do things like this (and more); and which wouldn't be restricted as much as "-s".

One thing -ss could do is remove the select from selects with only a single case (or default). Again, see #9966.

This issue is for discussion about whether gofmt should have a -ss flag and possibly also to collect ideas for what -ss might do over and above -s.

@griesemer
Copy link
Contributor

To be clear: gofmt itself should not contain the actual -ss code - that code should be in an independent package that can be invoked from elsewhere and that's simply hooked up to gofmt.

@rsc
Copy link
Contributor

rsc commented Apr 10, 2015

Make a separate tool. Let's not keep piling things into gofmt just because it happens to read and write Go files.

I'd be happy if you want to put this in grind.

@rsc rsc closed this as completed Apr 10, 2015
@griesemer
Copy link
Contributor

Separate tool is fine. I'd still suggest to have the actual machinery factored out into a library so that it can be used easily elsewhere.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants