You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling *File.Cleanup it ends up causing future edits to do nothing. If this is intended the method description should be updated to make it apparent that you shouldn't do any other edits after calling it.
We have a script that parses the go.mod in a project and updates all of the requires and then updates the replacements. If a requires ends up invalidating a replacement then we drop the replacement and then need to call Cleanup before looping over *File.Replace since there might be empty entries in there now.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/PQwdaFv3Pgp
When calling
*File.Cleanup
it ends up causing future edits to do nothing. If this is intended the method description should be updated to make it apparent that you shouldn't do any other edits after calling it.We have a script that parses the go.mod in a project and updates all of the requires and then updates the replacements. If a requires ends up invalidating a replacement then we drop the replacement and then need to call Cleanup before looping over
*File.Replace
since there might be empty entries in there now.What did you expect to see?
I expected to see
Which means that
Cleanup
does not break future edits.What did you see instead?
Instead I saw:
The text was updated successfully, but these errors were encountered: