tools/present
Peter Weinbergr 559c4300da 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>
2023-09-12 20:13:37 +00:00
..
testdata present: don't drop commands that immediately follow text 2021-03-19 17:28:02 +00:00
args.go all: fix a few function names on comments 2022-10-10 13:22:38 +00:00
caption.go present: retain complete caption command when parsing captions 2021-03-19 17:27:31 +00:00
code.go all: gofmt 2022-04-12 17:53:17 +00:00
code_test.go all: remove many cases of space-space 2019-12-30 19:07:42 +00:00
doc.go present: reformat doc comment for lack of inline code 2023-05-20 21:12:47 +00:00
html.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
iframe.go present: record info in AST for reproducing present inputs 2020-03-13 20:55:18 +00:00
image.go present: record info in AST for reproducing present inputs 2020-03-13 20:55:18 +00:00
link.go present: record info in AST for reproducing present inputs 2020-03-13 20:55:18 +00:00
link_test.go go.tools/godoc/present: move present package from go.talks 2013-09-19 10:55:46 +10:00
parse.go tools: replace references to obsolete package ioutils 2023-09-12 20:13:37 +00:00
parse_test.go tools: replace references to obsolete package ioutils 2023-09-12 20:13:37 +00:00
style.go x/tools: simplify and format code 2017-02-28 14:15:42 +00:00
style_test.go present: allow markup inside punctuation connected to other text 2016-12-01 05:16:25 +00:00
video.go present: record info in AST for reproducing present inputs 2020-03-13 20:55:18 +00:00