]> Cypherpunks.ru repositories - gostls13.git/commit
all: update to use os.ReadDir where appropriate
authorRuss Cox <rsc@golang.org>
Thu, 29 Oct 2020 18:46:29 +0000 (14:46 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 9 Dec 2020 19:12:27 +0000 (19:12 +0000)
commitf1980efb92c011eab71aa61b68ccf58d845d1de7
tree8bfed500207b38cba5fc254c2531a9760d6a0154
parent4f1b0a44cb46f3df28f5ef82e5769ebeac1bc493
all: update to use os.ReadDir where appropriate

os.ReadDir is a replacement for ioutil.ReadDir that returns
a slice of fs.DirEntry instead of fs.FileInfo, meaning it is the
more efficient form.

This CL updates call sites throughout the Go source tree
wherever possible. As usual, code built using the Go 1.4
bootstrap toolchain is not included. There is also a use in
go/build that appears in the public API and can't be changed,
at least not without additional changes.

Fixes #42026.

Change-Id: Icfc9dd52c6045020f6830e22c72128499462d561
Reviewed-on: https://go-review.googlesource.com/c/go/+/266366
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
19 files changed:
src/cmd/go/internal/clean/clean.go
src/cmd/go/internal/imports/scan_test.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/modcmd/vendor.go
src/cmd/go/internal/modfetch/cache.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/test/test.go
src/cmd/go/proxy_test.go
src/crypto/x509/root_unix.go
src/go/build/deps_test.go
src/go/internal/gcimporter/gcimporter_test.go
src/go/internal/srcimporter/srcimporter_test.go
src/go/parser/error_test.go
src/go/parser/interface.go
src/go/types/check_test.go
src/go/types/stdlib_test.go
src/internal/trace/parser_test.go
src/os/exec/exec_test.go
src/testing/testing_test.go