-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: replace references to obsolete package ioutils
ioutil defines 7 functions. 6 of these are replaced by functions in io or os with the same signature. ReadDir is deprecated, but the suggested replacement has a different signature. These changes were generated by a program, with some manual adjutments. The program replaces ReadDir with a call to a function named ioutilReadDir that has the same signature. The code for this function is added to files if necessary. The program replaces all the others with their new versions. The program removes the 'io/ioutil' import and adds, as necessary, 'os', 'io', and 'io/fs', the latter being needed for the signature of ioutilReadDir. The automatic process fails in a few ways: 1. ReadFile occurs only in a comment but the program adds an unneeded import. 2. ioutilReadDir is added to more than one file in the same package Both of these could be viewed as bugs and fixed by looking harder. After manual adjustment, two tests failed: 1. gopls/internal/lsp/regtesg/mis:TestGenerateProgress. The reason was a use of ioutil in a txtar constant. The calls were changed, but the code is not smart enough to change the import inside the string constant. (Or it's not smart enough not to change the contents of a string.) 2. gopls/internal/lsp/analysis/deprecated, which wants to see a use of ioutil These tests were adjused by hand, and all tests (-short) pass. Change-Id: If9efe40bbb0edda36173d9a88afaf71245db8e79 Reviewed-on: https://go-review.googlesource.com/c/tools/+/527675 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Peter Weinberger <pjw@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
- Loading branch information
Showing
117 changed files
with
389 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.