From 3c3603f368e2be517cdd946ae6a666d4e1eda67a Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Sat, 26 Mar 2022 00:00:28 -0700 Subject: [PATCH] io/ioutil: Deprecate `TempFile` and `TempDir` These were deprecated in `go` `1.17`, so marked them as officially `Deprecated: `. Fix https://github.com/golang/go/issues/51927 --- src/io/ioutil/tempfile.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io/ioutil/tempfile.go b/src/io/ioutil/tempfile.go index c43db2c080..0561ad5a27 100644 --- a/src/io/ioutil/tempfile.go +++ b/src/io/ioutil/tempfile.go @@ -20,7 +20,7 @@ import ( // to find the pathname of the file. It is the caller's responsibility // to remove the file when no longer needed. // -// As of Go 1.17, this function simply calls os.CreateTemp. +// Deprecated: As of Go 1.17, this function simply calls os.CreateTemp. func TempFile(dir, pattern string) (f *os.File, err error) { return os.CreateTemp(dir, pattern) } @@ -35,7 +35,7 @@ func TempFile(dir, pattern string) (f *os.File, err error) { // will not choose the same directory. It is the caller's responsibility // to remove the directory when no longer needed. // -// As of Go 1.17, this function simply calls os.MkdirTemp. +// Deprecated: As of Go 1.17, this function simply calls os.MkdirTemp. func TempDir(dir, pattern string) (name string, err error) { return os.MkdirTemp(dir, pattern) }