Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
x/tools/cmd/gorename: panics when displaying diff #14009
This is for the golang/tools repository, but can't open an issue there.
Running gorename with the diff display option panics when diff returns no data. Because err is not checked (because of the diff return codes) before display, the display part can panic when the diff output is nil.
My run on my local machine gave me a panic:
I will be submitting a small patch to prevent this panic and provide some output.
Adding logic to set stdout to os.Stdout fixed the issue. The test used inside knowledge of the files to set the stdout variable to os.Stdout when running tests. To not break the tests, I've not restructured the files but added some logic to the flag parsing to set stdout properly. I'm working on getting gerrit set up to submit a patch.