We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Here is a diff example of bare return rewrite when using goreturns -b -i -l -w .:
goreturns -b -i -l -w .
if err != nil { - return + return output, + + // Processing output + err } - // Processing output if updateCache {
expected result:
if err != nil { - return + return output, err } // Processing output if updateCache {
It is interesting that the rewrite escapes the {...} block.
{...}
The text was updated successfully, but these errors were encountered:
Heh, just came across this myself.
Preserving the comment structure is hard... golang/go#18593
Edit:
and another useful reference, seems it is being considered ongoing: golang/go#20744
Someone made another package representing the comments in another way which looks useful: https://github.com/dave/dst
Sorry, something went wrong.
Hey there! Author of dst here... It should fix this problem. If you give it a go, let me know how it works...
dst
No branches or pull requests
Here is a diff example of bare return rewrite when using
goreturns -b -i -l -w .
:expected result:
It is interesting that the rewrite escapes the
{...}
block.The text was updated successfully, but these errors were encountered: